Get ID? - help!
#1

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;
}
Reply
#2

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;
}
Reply
#3

sry i made a wrong answer
Reply
#4

@Areax

Thanks.
Reply
#5

Quote:
Originally Posted by Chrillzen
Посмотреть сообщение
@Areax

Thanks.
No problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)