Disarm player after death. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Disarm player after death. (
/showthread.php?tid=152676)
Disarm player after death. -
Ozwell_Spencer - 05.06.2010
Hello, I am wondering how to disarm a player after they die, and then give them a chainsaw for a weapon. (Doesn't have to be a chainsaw, just an example.)
Re: Disarm player after death. -
UsaBoy91 - 05.06.2010
Can you explain more good ?
Re: Disarm player after death. -
Ozwell_Spencer - 05.06.2010
After the player dies, I want to remove their current weapons and give them a chainsaw. (Zombie gamemode)
Re: Disarm player after death. -
iStarzz - 05.06.2010
I'm sure you can do the rest
pawn Код:
new soldier[MAX_PLAYERS] = 1;
new zombie[MAX_PLAYERS] = 0;
OnPlayerSpawn(playerid)
{
if(soldier[playerid] == 1)
{
//code for weapons
}
else if(zombie[playerid] == 1)
{
//code for weapons
}
OnPlayerDeath(playerid,killerid,reason)
{
soldier[playerid] = 0;
zombie[playerid] = 1;
Re: Disarm player after death. -
Ozwell_Spencer - 05.06.2010
I can't do the rest actually, I am a n00b scripter, I just have good ideas for my server.
Re: Disarm player after death. -
Ozwell_Spencer - 05.06.2010
I don't need the player's team to change, I just need to change the weapons they have.
Re: Disarm player after death. -
DJDhan - 05.06.2010
Код:
new soldier[MAX_PLAYERS] = 1;
new zombie[MAX_PLAYERS] = 0;
OnPlayerSpawn(playerid)
{
if(soldier[playerid] == 1)
{
//code for weapons //get the weapon ids and below is an example on how to give a player a weapon
}
else if(zombie[playerid] == 1)
{
SetPlayerSkin(playerid,skinid); //replace the skinid with a zombie id of your choice.
GivePlayerWeapon(playerid,9,1); //chainsaw
}
OnPlayerDeath(playerid,killerid,reason)
{
ResetPlayerWeapns(playerid);
soldier[playerid] = 0;
zombie[playerid] = 1;
return 1;
}
You can find the Weapon IDs'
HERE
Re: Disarm player after death. -
Ozwell_Spencer - 05.06.2010
I don't need the whole team system, I already have that part setup. I just need to give the player only a chainsaw after spawning.
Re: Disarm player after death. -
UsaBoy91 - 05.06.2010
pawn Код:
// OnPlayerDeath
ResetPlayerWeapons(playerid);
// OnPlayerSpawn
GivePlayerWeapon(playerid,9,1);
Re: Disarm player after death. -
Ozwell_Spencer - 05.06.2010
If I'm not mistaken, wouldn't that make all the characters start off with a chainsaw?