A little problem with the Kick command.
#1

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-")
Reply
#2

wrong section.
Reply
#3

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!");
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)