Weapons Losing .. - 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: Weapons Losing .. (
/showthread.php?tid=516301)
-Deleted- -
GeekSiMo - 30.05.2014
-Deleted-
Re : Weapons Losing .. -
S4t3K - 30.05.2014
Get the player weapons when he death, then give him when he spawns.
Store the weapons in an array (13 cells will be enough), get them in "OnPlayerDeath", create a boolean var set to false by default and set it to true when the player death. in "OnPlayerSpawn", set this var to false after giving the weapon.
Re: Weapons Losing .. -
GeekSiMo - 30.05.2014
show me how plzz !
Re: Weapons Losing .. -
Dangjai - 30.05.2014
Quote:
Originally Posted by GeekSiMo
show me how plzz !
|
this better to learn yourself ...
Re : Weapons Losing .. -
S4t3K - 30.05.2014
PHP код:
new weapons[MAX_PLAYERS][13][2], bool:death[MAX_PLAYERS] = false;
public OnPlayerDeath(playerid, killerid, reason)
{
for(new s = 0; s < 12; s++)
{
GetPlayerWeaponData(playerid, s, weapons[playerid][s][1], weapons[playerid][s][2]);
}
death[playerid] = true;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(death[playerid])
{
for(new s = 0; s < 12; s++)
{
GivePlayerWeapon(playerid, weapons[playerid][s][1], weapons[playerid][s][2]);
}
death[playerid] = false;
}
return 1;
}