Započeo ZC_Bob
•5. Sep. 2013.• Zaključano[Pomoc] /mute
446
pregleda
8
postova
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
301
Postovi:
60
Teme:
Pridružio se:Sep. 2012
5. Sep. 2013.
Skripta koju koristim: SE-RP
Detaljan opis problema: Kada mute igrace, on moze da prica na /b , /s , /w , samo onaj obican chat mu je mute i tamo ne moze da pise, ja kad dodam deo koji sluzi da mute igraca, radi dobro, i ne moze da prica na /b i na /s ali ispise mu ispod toga ono "SERVER:Unknown Command" , ja ne zelim da mi ispisuje to... Pa gde treba da stavim taj kod da mi ne pise to? 😄
Dio skripte:
deo za mute:
komanda /mute:
komanda /s
Neke slike/video za lakse dobivanje pomoci(neobavezno): recite ako treba jos nesto...
Detaljan opis problema: Kada mute igrace, on moze da prica na /b , /s , /w , samo onaj obican chat mu je mute i tamo ne moze da pise, ja kad dodam deo koji sluzi da mute igraca, radi dobro, i ne moze da prica na /b i na /s ali ispise mu ispod toga ono "SERVER:Unknown Command" , ja ne zelim da mi ispisuje to... Pa gde treba da stavim taj kod da mi ne pise to? 😄
Dio skripte:
deo za mute:
if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozes pricati, mutiran si!");
return 0;
}komanda /mute:
if(strcmp(cmd, "/mute", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: /mute [ID Igraca/Dio Imena]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo >= 1 || PlayerInfo >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo == 0)
{
PlayerInfo = 1;
printf("AdmCmd: %s silenced %s",sendername, giveplayer);
format(string, sizeof(string), ": Igracu %s-u je oduzeto pravo govora od strane Admina %s-a.",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
PlayerInfo = 0;
printf("AdmCmd: %s unsilenced %s",sendername, giveplayer);
format(string, sizeof(string), ": Igracu %s-u je dato pravo govora od strane Admina %s-a.",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}komanda /s
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/s)hout [local chat]");
return 1;
}
new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
for(new b = 0; b < sizeof brojevi; b++)
{
new tekst = strlen(result);
for(new i = 0; i {
if(result == brojevi)
result = '*' ;
}
}
if(PlayerInfo == 1)
{
format(string, sizeof(string), "Stranac vice: %s!!", result);
}
else
{
format(string, sizeof(string), "%s vice: %s!!", sendername, result);
}
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}Neke slike/video za lakse dobivanje pomoci(neobavezno): recite ako treba jos nesto...
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
34
Postovi:
6
Teme:
Pridružio se:Sep. 2012
5. Sep. 2013.
probaj ovako
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Niste se prijavili !");
return 1;
if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/s)hout [local chat]");
return 1;
}
new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
for(new b = 0; b < sizeof brojevi; b++)
{
new tekst = strlen(result);
for(new i = 0; i {
if(result == brojevi)
result = '*' ;
}
}
if(PlayerInfo == 1)
{
format(string, sizeof(string), "Stranac vice: %s!!", result);
}
else
{
format(string, sizeof(string), "%s vice: %s!!", sendername, result);
}
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
40 / 100 XP
Početnik(0)
34
Postovi:
12
Teme:
Pridružio se:Okt. 2011
5. Sep. 2013.
takodje mozes i sa publicom
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(PlayerInfo == 1 && (!strcmp(cmdtext, "/s") || !strcmp(cmdtext, "/shout")))
{
SendClientMessage(playerid, 0xFFFFFFAA, "Ovde tekst koji cemu ispisivati");
return 0;
}
return 1;
}
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
301
Postovi:
60
Teme:
Pridružio se:Sep. 2012
6. Sep. 2013.
@Zoran123456
Ne moze tako da return 1; bude tamo, i dobijam samo errore...
@Smaracx
Probat cu ovo, mada ja bih radije u cmd da samo ubacim ono pa da ne moze da prica, i ako bih ubacio ovo
dal treba da ga stavim gore ili dole kod /s komande?
Ne moze tako da return 1; bude tamo, i dobijam samo errore...
@Smaracx
Probat cu ovo, mada ja bih radije u cmd da samo ubacim ono pa da ne moze da prica, i ako bih ubacio ovo
if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozes pricati, mutiran si!");
return 0;
}dal treba da ga stavim gore ili dole kod /s komande?
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
34
Postovi:
6
Teme:
Pridružio se:Sep. 2012
6. Sep. 2013.
evo ti cmd pa pgoeldaj
if(strcmp(cmd, "/shout2", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(DraoSe == 1)
{
SCM(playerid,COLOR_GRAD1,"Sacekaj 10 sekundi pre nego sto iskoristis to opet !!");
return 1;
}
if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /s [local chat]");
return 1;
}
if(PlayerInfo == 1)
{
LoopingAnim(playerid,"ON_LOOKERS","shout_01",3.0,1,0,0,0,0);
format(string, sizeof(string), "{80C8FE}Stranac se dere{FFFFFF}: %s!!", result);
DraoSe = 1;
SetTimerEx("DranjeReset", 10000, false, "i", playerid);
}
else
{
ReduceTime = 1;
SetTimerEx("ReduceTimer", 30000, false, "i", playerid);
LoopingAnim(playerid,"ON_LOOKERS","shout_01",3.0,1,0,0,0,0);
format(string, sizeof(string), "{80C8FE}%s se dere{FFFFFF}: %s!!", sendername, result);
DraoSe = 1;
SetTimerEx("DranjeReset", 10000, false, "i", playerid);
}
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}
if(strcmp(cmd, "/shout2", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(DraoSe == 1)
{
SCM(playerid,COLOR_GRAD1,"Sacekaj 10 sekundi pre nego sto iskoristis to opet !!");
return 1;
}
if(PlayerInfo == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Ne mozete pricati, oduzeto vam je pravo govora !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /s [local chat]");
return 1;
}
if(PlayerInfo == 1)
{
LoopingAnim(playerid,"ON_LOOKERS","shout_01",3.0,1,0,0,0,0);
format(string, sizeof(string), "{80C8FE}Stranac se dere{FFFFFF}: %s!!", result);
DraoSe = 1;
SetTimerEx("DranjeReset", 10000, false, "i", playerid);
}
else
{
ReduceTime = 1;
SetTimerEx("ReduceTimer", 30000, false, "i", playerid);
LoopingAnim(playerid,"ON_LOOKERS","shout_01",3.0,1,0,0,0,0);
format(string, sizeof(string), "{80C8FE}%s se dere{FFFFFF}: %s!!", sendername, result);
DraoSe = 1;
SetTimerEx("DranjeReset", 10000, false, "i", playerid);
}
ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
printf("%s", string);
}
return 1;
}
Enforcer
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
301
Postovi:
60
Teme:
Pridružio se:Sep. 2012
7. Sep. 2013.
@|LZ| Bugi
Ne radi ovo 😄
Nema veze, dodat cu onako pa neka mi ispisuje ono "SERVER:Unknown Command" kad drugacije ne moze izgleda 😢
Mozda bih moglo da je u ZCMD ali posto nije onda nista... 🙂
Ne radi ovo 😄
Nema veze, dodat cu onako pa neka mi ispisuje ono "SERVER:Unknown Command" kad drugacije ne moze izgleda 😢
Mozda bih moglo da je u ZCMD ali posto nije onda nista... 🙂
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava