SA-MP Forums Archive
SetPlayerName not working after format()? - 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: SetPlayerName not working after format()? (/showthread.php?tid=463188)



SetPlayerName not working after format()? - DarrenReeder - 10.09.2013

Hello forums.

I try use the forum to get help as little as possible so I work stuff out. But this has stumped me for the past 24 hours...

Here is my first step of the mask command:

pawn Код:
CMD:masktest(playerid, params[]){
    new newName[MAX_PLAYER_NAME];
    format(newName, sizeof(newName), "Mask %d", playerVariables[playerid][pMask]);
    SetPlayerName(playerid, newName);

    return 1;
}
When i use this it just does... nothing.

If i use this though:

pawn Код:
CMD:masktest(playerid, params[]){
    new newName[MAX_PLAYER_NAME];
    format(newName, sizeof(newName), "Mask %d", playerVariables[playerid][pMask]);
    SetPlayerName(playerid, "test");

    return 1;
}
It works fine and changes my name to "test"... any ideas? If you need any other code, just request...

Thanks alot.


Re: SetPlayerName not working after format()? - IstuntmanI - 10.09.2013

You can't use spaces in SetPlayerName.

https://sampwiki.blast.hk/wiki/SetPlayerName