SA-MP Forums Archive
No weapon on 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: No weapon on spawn (/showthread.php?tid=431972)



No weapon on spawn - NicholasA - 20.04.2013

When the player becomes a zombie he doesn't get a chainsaw
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetCameraBehindPlayer(playerid);// Zombie stats
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerHealth(playerid, 100);
    SetSpawnInfo(playerid, 0, 162, 2143.5872,-1166.8904,23.9922, 9, 0, 0, 0, 0, 0, 0);
    SetPlayerArmour(playerid, 50);
    SetPlayerTeam(playerid, 2);
    SendClientMessage(playerid, COL_GREY, "You became a zombie, kill a human to turn human again");
    SpawnPlayer(playerid);//
    SetCameraBehindPlayer(killerid); // Killer stats
    SetPlayerVirtualWorld(killerid, 0);
    SetPlayerInterior(killerid, 0);
    SetPlayerHealth(killerid, 55);
    SetPlayerArmour(killerid, 0);
    SetPlayerSkin(killerid, 98);
    SetPlayerTeam(killerid, 1);
    SetPlayerPos(killerid,738.8650,-1418.0709,13.5234);
    SendClientMessage(killerid, COL_GREY, "You became human again");//
	return 1;
}



Re: No weapon on spawn - gtakillerIV - 20.04.2013

Remove the SetSpawnInfo, and use GivePlayerWeapon.


EDIT:

Didin't notice that you added it under OnPlayerDeath. As the guy below said, add it under OnPlayerSpawn. Make a bool to check if he spawned and died and check under OnPlayerSpawn if he did die or not.


AW: No weapon on spawn - HurtLocker - 20.04.2013

When you die, the spawn function is trigerred automatically even if you include that SpanwPlayer line and resets your settings you define in playerdeath. If you dont want to add those lines with weapons and etc under onplayerspawn (for reason i can't imagine), activate a non-repeating timer as soon the player dies which will eventually give the weapons-settings.