SA-MP Forums Archive
/ID Bug? *HELP* - 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)
+--- Thread: /ID Bug? *HELP* (/showthread.php?tid=307820)



/ID Bug? *HELP* - Jing_Chan - 01.01.2012

Quote:

}

CMD:id(playerid, params[])
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [playerid]");

if(IsPlayerConnected(giveplayerid))
{
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetPlayerNameEx(giveplayerid), PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
return 1;
}

That is my code for my /id
say id 1 was "A" and id 2 was "B"

i type /id 1 and it would say B instead of A

whats wrong with this? please help


Re: /ID Bug? *HELP* - THE_KNOWN - 01.01.2012

sscanf problem maybe? try updating it


Re: /ID Bug? *HELP* - Aira - 01.01.2012

Try This One
Quote:

CMD:id(playerid, params[])
{
new id, name[MAX_PLAYER_NAME], string[128];
if(sscanf(params,"u", id)) return SCM(playerid, COLOR_GREY,"USAGE: /id [playerid/partofname]");
if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_GREY,"Player not connected");
else
{
GetPlayerName(id, name, sizeof(name));
format(string,sizeof(string), "ID: (%d) %s", id, name);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}




Re: /ID Bug? *HELP* - Jing_Chan - 01.01.2012

Quote:

C:\Users\James\Desktop\ngrpbugfix\Next Generation Roleplay\gamemodes\bfrp.pwn(28895) : error 017: undefined symbol "SCM"
C:\Users\James\Desktop\ngrpbugfix\Next Generation Roleplay\gamemodes\bfrp.pwn(28896) : error 017: undefined symbol "SCM"

That is the compilation error


Re: /ID Bug? *HELP* - vassilis - 01.01.2012

top of the script #define SCM SendClientMessage