SA-MP Forums Archive
PLAYER_STATE_WASTED After First Spawn - 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: PLAYER_STATE_WASTED After First Spawn (/showthread.php?tid=376868)



PLAYER_STATE_WASTED After First Spawn - dudaefj - 11.09.2012

Hello

i'm trying to script a RP gamemode, but sometimes after make the first spawn my char dies by reason 255 and the calback OnPlayerStateChange is caled by new state = 7

Look the callbacks backtrace:


PHP код:
[11/09/12 19:56:31OnPlayerConnect  // When I connect
[11/09/12 19:56:31connections => Bot_Bsli conectou no servidor. (idIP127.0.0.1)
[
11/09/12 19:56:35OnPlayerRequestClass // Some seconds after connection
[11/09/12 19:56:45OnDialogResponse //After put my password on dialog login
[11/09/12 19:56:47OnPlayerStateChange(080// A spawn in progress
[11/09/12 19:56:47OnPlayerSpawn // the callback spawning me
[11/09/12 19:56:47OnPlayerStateChange(078)  // Here is where everything goes to a weird way
[11/09/12 19:56:47OnPlayerDeath(065535255// Weird die by a weird reason
[11/09/12 19:56:47] [deathBot_Bsli died 255
[11/09/12 19:56:53OnPlayerStateChange(087)
[
11/09/12 19:56:53OnPlayerSpawn // now everything go alright and I got a nice spawn 
does anyone know why is it happening?


Re: PLAYER_STATE_WASTED After First Spawn - Kirollos - 12.09.2012

show us OnPlayerSpawn and OnPlayerStateChange ?


Re: PLAYER_STATE_WASTED After First Spawn - dudaefj - 13.09.2012

OnPlayerSpawn was empty
I mean, I tried to comment it (put under /* code here */) to see if anything changed

Quote:

public OnPlayerSpawn(playerid)
{
AntiDeAMX();
WasteDeAMXersTime();
return 1;
}

and the OnPlayerStateChange here: http://pastebin.com/L680XZmx


I really can't believe it's reponsible by the problem...

I tried to make some experiences...
putting the first spawn on OnPlayerConnect (before the login box)
I got the same error
but, how sooner on OnPlayerConnect function I've put the spawn function, lower the possibility to have the die bug on spawn

If I put the spawn on the end of OnPlayerConnect, on ~50% times I got killed
If I put the spawn on the middle of OnPlayerConnect, I've got around 15% times killed after spawn

if you want my OnPlayerConnect: http://pastebin.com/3RbcgVun


Re: PLAYER_STATE_WASTED After First Spawn - Slaykler - 13.09.2012

What is your Gravity Level set too? Due to That could be killing your character everytime you spawn. Have you altered your Gravity settings at all?


Re: PLAYER_STATE_WASTED After First Spawn - dudaefj - 13.09.2012

gravity = 0.008

if it would be the gravity, it would happen any time, not just on first spawn =(