Hi, how to solve cmdtext with zcmd?
I've declared strtok and ReturnUser
Errors
I've declared strtok and ReturnUser
PHP Code:
forward OnPlayerCommandReceived(playerid, cmdtext[]);
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
CMD:id(playerid, params[]) {
new tmp[256];
new idx;
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "/id [id/nome]");
return 1;
}
new target;
target = ReturnUser(tmp);
new sstring[256];
if(IsPlayerConnected(target))
{
if(target != INVALID_PLAYER_ID)
{
format(sstring, sizeof(sstring), "Nome: %s [ID: %d]",GetPlayerNameEx(target),target);
SendClientMessage(playerid, COLOR_LIGHTBLUE, sstring);
}
}
}
return 1;
}
Code:
.pwn(345) : warning 217: loose indentation
.pwn(347) : error 017: undefined symbol "cmdtext"
.pwn(360) : error 017: undefined symbol "GetPlayerNameEx"
.pwn(344) : warning 203: symbol is never used: "idx"
2 Errors.