if (strcmp("/id", cmdtext, true, 10) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /id [playerid/PartOfName]"); return 1; } new target; target = ReturnUser(tmp); new sstring[128]; if(IsPlayerConnected(target)) { if(target != INVALID_PLAYER_ID) { GetPlayerName(target, giveplayer, sizeof(giveplayer)); format(sstring, sizeof(sstring), "ID: (%d) %s",target,giveplayer); SendClientMessage(playerid, COLOR_GRAD1, sstring); } } } return 1; }
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(772) : error 017: undefined symbol "tmp" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(772) : error 017: undefined symbol "strtok" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(773) : error 017: undefined symbol "tmp" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(775) : error 017: undefined symbol "COLOR_GRAD2" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(779) : error 017: undefined symbol "ReturnUser" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(785) : error 017: undefined symbol "giveplayer" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(785) : error 017: undefined symbol "giveplayer" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(785) : error 029: invalid expression, assumed zero H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(785) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
strtok(const string[], &index) { new length = strlen(string); while ((index < length) && (string[index] <= ' ')) { index++; } new offset = index; new result[20]; while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1))) { result[index - offset] = string[index]; index++; } result[index - offset] = EOS; return result; }
if (strcmp("/id", cmdtext, true, 10) == 0)
{
new tmp[128], giveplayer[MAX_PLAYER_NAME], idx;
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, -1, "USAGE: /id [playerid/PartOfName]");
return 1;
}
new target = strval(tmp);
new sstring[128];
if(IsPlayerConnected(target))
{
if(target != INVALID_PLAYER_ID)
{
GetPlayerName(target, giveplayer, sizeof(giveplayer));
format(sstring, sizeof(sstring), "ID: (%d) %s",target,giveplayer);
SendClientMessage(playerid, -1, sstring);
}
}
}
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands.."); return 1; }
H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(739) : error 029: invalid expression, assumed zero H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(739) : error 004: function "OnPlayerCommandPerformed" is not implemented H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(741) : error 017: undefined symbol "success" H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(744) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
How to fix that?
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) { SendClientMessage(playerid, -1, "That command does not exist. Use /help or /commands.."); return 1; } } |
:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(739) : error 029: invalid expression, assumed zero H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(739) : error 004: function "OnPlayerCommandPerformed" is not implemented H:\CokeTDM [0.3e]\gamemodes\NpTDM.pwn(741) : error 017: undefined symbol "success" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) { new string[70]; format(string, sizeof(string), "Error: {FFFFFF}The command '%s' was not recognised, please type /help.", cmdtext); SendClientMessage(playerid, -1, string); } return 1; } |
Use code like this
To the guy above, what is that, useless comment |
H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(81) : error 029: invalid expression, assumed zero H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(81) : error 017: undefined symbol "OnPlayerCommandPerformed" H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(82) : warning 217: loose indentation H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(83) : error 017: undefined symbol "success" H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(91) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
Код:
H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(81) : error 029: invalid expression, assumed zero H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(81) : error 017: undefined symbol "OnPlayerCommandPerformed" H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(82) : warning 217: loose indentation H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(83) : error 017: undefined symbol "success" H:\CokeTDM [0.3e]\filterscripts\CMD.pwn(91) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |