11.03.2013, 10:48
Alternate Fix
I'm aware that you can remove few lines from what is being stated in this post but SA-MP acts weird sometimes so I'm just making sure that nothing would go off the plan.
Make a public variable on top of your script.
Add this to the following callbacks: OnPlayerConnect & OnPlayerDisconnect
Add this to the following callbacks: OnGameModeInit, OnGameModeExit
Add this to the following callback: OnPlayerSpawn
Now change your code to:
I'm aware that you can remove few lines from what is being stated in this post but SA-MP acts weird sometimes so I'm just making sure that nothing would go off the plan.
Make a public variable on top of your script.
pawn Code:
new Spawned[MAX_PLAYERS];
pawn Code:
Spawned[playerid] = 0;
pawn Code:
for(new i = 0; i < MAX_PLAYERS; i++)
{
Spawned[i] = 0;
}
pawn Code:
Spawned[playerid] = 1;
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(!Spawned[playerid])
{
Spawned[playerid] = 1;
}
else
{
SendClientMessage(playerid, -1, "This will get called after restart on spawn");
//Other Code
}
return 1;
}