if (strcmp(cmd, "/kill", true) == 0) //line 281
{ //line 282
if(IsPlayerConnected(playerid))//line 282
{//line 283
if (gPlayerLogged[playerid] != 0)//line 284
{//line 285
SendClientMessage(playerid, COLOR_RED, "You have fallen unconscious due to servere wounds!");//line 286
InjuredSpawn[playerid] = 1;//line 287
}//line 289
else//line 290
{ //line 291
SendClientMessage(playerid, COLOR_GRAY, "[!] You are not logged in!"); //line 292
return 1; //line 293
} //line 294
C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(281) : error 010: invalid function or declaration C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(283) : error 010: invalid function or declaration C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(285) : error 010: invalid function or declaration C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(290) : error 010: invalid function or declaration C:\Users\Lachlan\Desktop\Random Pawno\AntonioRP.pwn(293) : error 010: invalid function or declaration
if (strcmp(cmd, "/kill", true) == 0)
{
if(IsPlayerConnected(playerid))// Actually there's no need to check if the player is connected. He can't type the cmd without being online.
{
if (gPlayerLogged[playerid] != 0)
{
SendClientMessage(playerid, COLOR_RED, "You have fallen unconscious due to servere wounds!");
InjuredSpawn[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAY, "[!] You are not logged in!"); //line 292
}
}//You forgot this bracket
return 1;//moved this.
}//And you forgot this bracket!
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if (strcmp(cmd, "/kill", true) == 0)
if (strcmp(cmdtext, "/kill", true) == 0)
if(strcmp(cmdtext, "/kill", true) == 0)
{
if(gPlayerLogged[playerid] != 1) return SendClientMessage(playerid, COLOR_GRAY, "[!] You are not logged in!");
SendClientMessage(playerid, COLOR_RED, "You have fallen unconscious due to servere wounds!");
InjuredSpawn[playerid] = 1;
return 1;
}
Originally Posted by |∞|-Рцппσĵσ-|∞|
Are you sure you're placing the code in the right place?
Inside the "OnPlayerCommandText" callback! strtok is slow, but quite good for some functions. You don't need strtok for this kind of command. |