[Help] - SetVIP || About Target's Name and Target's ID
#8

as i have said,You are getting the name of the targetid before getting the string he wrote,and when you do that it always gets id 0's name,so it shows wrong name,and makes the id you wrote the thing you want it to make him,so command of pingplayer should be:
pawn Код:
CMD:pingplayer(playerid, params[])
{
    new ppString[500];

    new tName[MAX_PLAYER_NAME];
    new targetid;

    new playerPing = GetPlayerPing(targetid);

    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFF0000FF, "Correct Usage: /pingplayer [playerid]");
    if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "Invalid Player ID");
    GetPlayerName(targetid, tName, sizeof(tName));
    format(pStringS, sizeof(pStringS), "{FFFFFF}You have pinged {%06x}%s(%d) {FFFFFF}- (Current Ping: {FF0000}%d{FFFFFF})", (GetPlayerColor(targetid) >>> 8), tName, targetid, pPing);
    SendClientMessage(playerid, 0xFF0000FF, pStringS);
    return 1;
}
and rittik,yea but the main problem wasnt the same as you said,it was the getting name thingy.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)