SA-MP Forums Archive
Sending name problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Sending name problem (/showthread.php?tid=175335)



Sending name problem - LifeStyle - 09.09.2010

It's not sending any name that has the most kills.
pawn Code:
forward TimeUp(playerid,notify);
public TimeUp(playerid,notify)
{
    new player;
    if(notify == 1)
    {
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(gKills[i] > gKills[playerid]) player = i;
    }
    GetPlayerName(player, gPlayerName, sizeof(gPlayerName));
    format(str, sizeof(str), "%s has won the match with the most kills.",player);
    Sendclientmessagetoall..........
        }
    return 1;
}



Re: Sending name problem - Mauzen - 09.09.2010

You put the name into gPlayerName and then try to read it from player. You also need to use gPlayerName in the format

pawn Code:
GetPlayerName(player, gPlayerName, sizeof(gPlayerName));
format(str, sizeof(str), "%s has won the match with the most kills.",gPlayerName);



Re: Sending name problem - LifeStyle - 09.09.2010

Ofcourse, fail xd