undefined simbol - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: undefined simbol (
/showthread.php?tid=175158)
undefined simbol -
HardMode - 08.09.2010
hi i get one error while compiling a pm command
Quote:
(391) : error 017: undefined symbol "params"
|
PHP код:
if(strcmp(cmd, "/pm", true) == 0)
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us", id, str2)) EDIT: Error is this line
{
SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
if(playerid != id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}
here is my code i make it from a toturial and now i cant fix this error i search on forums and nothing if someone can help im apreciate its a small code
Re: undefined simbol -
LarzI - 08.09.2010
Use dcmd instead of strcmp
Re: undefined simbol -
Mean - 08.09.2010
I always get errors with dcmd_[command] so i don't prefer to use it
Re: undefined simbol -
Lenny the Cup - 08.09.2010
change "params" for "inputtext"
OnPlayerCommandText uses "inputtext", dcmd uses params
Re: undefined simbol -
HardMode - 08.09.2010
params works fine.. with dcmd xD but something is wrong.. i downloaded "sscanf2" and put on my includes and since i did that no one command work anymore bah what i make wrong?
Re: undefined simbol -
LarzI - 08.09.2010
Then use zcmd.
You can't use sscanf for commands without zcmd or dcmd.