SA-MP Forums Archive
A little problem with the Kick command. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A little problem with the Kick command. (/showthread.php?tid=551349)



A little problem with the Kick command. - Lirbo - 18.12.2014

pawn Код:
CMD:kick(playerid,params[]){
LoggedCMD HelperCMD
if(sscanf(params,"us",KickTarget,Reason)) return MSG(playerid,C_RED,"[ERROR] {ff7777}/Kick <ID> <REASON>");
if(KickTarget == "Lirbo") return MSG(playerid,C_RED,"[ERROR] {FF7777}FUCK OFF!");
format(String,sizeof(String),"[ADMIN] {ff7777}%s has been kicked %s: %s",GetName(playerid),GetName(KickTarget),Reason);
MSGTA(C_RED,String);
SetTimerEx("KickDealy", 1000, false, "i", playerid);
return 1;}
The line with the problem:
if(KickTarget == "Lirbo") return MSG(playerid,C_RED,"[ERROR] {FF7777}FUCK OFF!");
error 033: array must be indexed (variable "-unknown-")


Re: A little problem with the Kick command. - Ahammad - 19.12.2014

wrong section.


Re: A little problem with the Kick command. - TakeiT - 19.12.2014

It doesn't work that way in pawn. You can do something like this: (You're trying to compare an id to a name)



pawn Код:
if(!strcmp(GetName(KickTarget), "Lirbo")) return  MSG(playerid,C_RED,"[ERROR] {FF7777}FUCK OFF!");



Re: A little problem with the Kick command. - Lirbo - 19.12.2014

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
It doesn't work that way in pawn. You can do something like this: (You're trying to compare an id to a name)



pawn Код:
if(!strcmp(GetName(KickTarget), "Lirbo")) return  MSG(playerid,C_RED,"[ERROR] {FF7777}FUCK OFF!");
Oh, wow thank you.