SA-MP Forums Archive
setplayername - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: setplayername (/showthread.php?tid=188896)



setplayername - Macluawn - 09.11.2010

using SetPlayerName in OnPlayerDisconnects causes server to crash.


Re: setplayername - Jay_ - 09.11.2010

Perhaps so but why would you want to set someones name when they disconnect in the first place


Re: setplayername - ••• ĤБĶБM ••• - 09.11.2010

Quote:
Originally Posted by Jay_
View Post
Perhaps so but why would you want to set someones name when they disconnect in the first place
Agreed seriously, why?


Re: setplayername - Macluawn - 09.11.2010

it doesnt matters, a bug is a bug.
^^


Re: setplayername - Mean - 13.11.2010

Ofc it happens, no one would use SetPlayerName in OnPlayerDisconnect
LoL why would you do it ina first place yeah,
and the thing is that it will try to change player's name, and playerid is disconnected already, so CRASH


Re: setplayername - Zh3r0 - 13.11.2010

Quote:
Originally Posted by Macluawn
View Post
it doesnt matters, a bug is a bug.
^^
No, i think it's logical for this to happen.
It's not like player is setting name first then quits.
Player quits first and then his name will be changed, but this won't happen because he left already and this will result in an epic crash.
Also this makes no sens at all, why would you set player's name? I mean this could be a good thing when you are saving it in a file or something, but.,


setplayername - [NoV]LaZ - 13.11.2010

Quote:
Originally Posted by Macluawn
View Post
using SetPlayerName in OnPlayerDisconnects causes server to crash.
Although setting the player's name when he's disconnecting doesn't make any sense, it won't crash the server. You should post the code you're using in OnPlayerDisconnect.


Re: setplayername - Retardedwolf - 13.11.2010

Tested it doesn't crash at all.

pawn Code:
public OnPlayerDisconnect ( playerid, reason )
{
    SetPlayerName   ( playerid, "LongGoneFag"  );
    printf          ( "%d%d", playerid, reason );

    return 1;
}



Re: setplayername - Macluawn - 13.11.2010

Quote:
Originally Posted by Zh3r0
View Post
No, i think it's logical for this to happen.
It's not like player is setting name first then quits.
Player quits first and then his name will be changed, but this won't happen because he left already and this will result in an epic crash.
Also this makes no sens at all, why would you set player's name? I mean this could be a good thing when you are saving it in a file or something, but.,
I tried it with gmx and kick, in both ways the server crashed.


setplayername - [NoV]LaZ - 13.11.2010

Quote:
Originally Posted by Macluawn
View Post
I tried it with gmx and kick, in both ways the server crashed.
Remove SetPlayerName and try again.
I've tested, and it did not crash the server when restarting it or kicking a player.