OnPlayerDeath HELP - 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: OnPlayerDeath HELP (
/showthread.php?tid=389720)
OnPlayerDeath HELP -
brightas - 03.11.2012
Hello everybody, i have problem with my OnPlayerDeath, when im dead, i have spawn menu, but i dont need it
http://www.part.lt/img/f9e4134bc1288...e0f212d926.png - Photo of the problem
When im press SPAWN, im spawned, and when im die another time, everything is okay...
When im do relog and die again, everything is fucked again. Someone help
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if ( killerid == INVALID_PLAYER_ID )
{
SetPlayerInterior ( playerid, 0 );
new Random = random(sizeof(RandomSpawns));
SetPlayerVirtualWorld ( playerid, 0 );
SetSpawnInfo( playerid, 0, GetPlayerSkin( playerid ), RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2],RandomSpawns[Random][3], 0, 0, 0, 0, 0, 0 );
}
pInfo [ playerid ] [ spawned ] = false;
return 1;
}
ONPLAYERSPAWN
Код:
if ( Numires[ playerid ])
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid,RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2] );
SetPlayerSkin( playerid, pInfo[ playerid ][ skinas ] );
SetPlayerFacingAngle ( playerid, RandomSpawns[Random][3] );
}
Re: OnPlayerDeath HELP -
DBan - 03.11.2012
I don't see you setting pInfo[playerid][spawned] to true when the player spawns. Maybe that's the source of the problem? Since you gave very little code, which by the way has nothing wrong with it from what I see, setting it to true may fix something outside of the code you gave. If it doesn't, then the problem is definitely not in the code given.
FYI: I don't even see the spawn menu you were talking about.