Get ID? - 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: Get ID? - help! (
/showthread.php?tid=470304)
Get ID? - help! -
Chrillzen - 17.10.2013
Hi, in my PM command I want to get both players ID. AKA PID and playerid. How do I do this?
Here's my command:
pawn Код:
CMD:pm(playerid, params[])
{
new PID, message[144], string[144];
if(sscanf(params, "uz", PID, message)) return SCM(playerid, COLOR_GREY, "[Usage]: /PM [PlayerID] [message].");
if(!IsPlayerConnected(PID)) return SCM(playerid, COLOR_LIGHTRED, "[Error]: That player is not connected.");
format(string, sizeof(string), "(( PM From: %s(%d): %s ))", GetName(PID), ID?, message);
SendClientMessage(PID, COLOR_YELLOW, string);
format(string, sizeof(string), "(( PM Sent: %s(%d): %s ))", GetName(playerid), ID?, message);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
Re: Get ID? - help! -
Areax - 17.10.2013
Try it
pawn Код:
CMD:pm(playerid, params[])
{
new PID, message[144], string[144];
if(sscanf(params, "uz", PID, message)) return SCM(playerid, COLOR_GREY, "[Usage]: /PM [PlayerID] [message].");
if(!IsPlayerConnected(PID)) return SCM(playerid, COLOR_LIGHTRED, "[Error]: That player is not connected.");
format(string, sizeof(string), "(( PM From: %s(%d): %s ))", GetName(PID), PID, message);
SendClientMessage(PID, COLOR_YELLOW, string);
format(string, sizeof(string), "(( PM Sent: %s(%d): %s ))", GetName(playerid), playerid, message);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
Re: Get ID? - help! -
newbie scripter - 17.10.2013
sry i made a wrong answer
Re: Get ID? - help! -
Chrillzen - 17.10.2013
@Areax
Thanks.
Re: Get ID? - help! -
Areax - 17.10.2013
Quote:
Originally Posted by Chrillzen
@Areax
Thanks. 
|
No problem