SendClientMessage
#10

Quote:
Originally Posted by cruising
Посмотреть сообщение
With this i get the message, but of some reason the name you get back is ID 0 always, who is my NPC :O
pawn Код:
CMD:setscore(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
     if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][Admin] >= 5)
        {
            new id;
            new sendername[MAX_PLAYER_NAME];
            new giveplayername[MAX_PLAYER_NAME];
            new giveplayerid,score;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
            if (!sscanf(params, "ui", giveplayerid,score)) // This was "ii" again
            {
                if (giveplayerid != INVALID_PLAYER_ID)
                {
                    new string[128];
                    format(string, sizeof(string), "The admin %s has set your score to %d",sendername,score);
                    SendClientMessage(giveplayerid, COLOR_GRAD1, string);
                    SetPlayerScore(giveplayerid, score);
                    format(string, sizeof(string), "You have set %s score to %d",giveplayername,score);
                    SendClientMessage(playerid, COLOR_GRAD1, string);
                }
            }
            else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setscore [playerid] [score]");
        }
        else SendClientMessage(playerid, 0xFF0000FF, "You are not an level 5 Admin!, or you are not a Admin!");
    }
    return 1;
}
Again there was "ii" as you can see in my comment
Reply


Messages In This Thread
SendClientMessage - by cruising - 02.07.2011, 14:49
Re: SendClientMessage - by Jay. - 02.07.2011, 14:51
Re: SendClientMessage - by cruising - 02.07.2011, 15:10
Re: SendClientMessage - by iPLEOMAX - 02.07.2011, 15:12
Re: SendClientMessage - by Wesley221 - 02.07.2011, 15:12
Re: SendClientMessage - by cruising - 02.07.2011, 15:32
Re: SendClientMessage - by Gazmull - 02.07.2011, 15:37
Re: SendClientMessage - by Sasino97 - 02.07.2011, 15:38
Re: SendClientMessage - by cruising - 02.07.2011, 19:16
Re: SendClientMessage - by Wesley221 - 02.07.2011, 19:36

Forum Jump:


Users browsing this thread: 1 Guest(s)