[HELP]Weapons after dead - 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: [HELP]Weapons after dead (
/showthread.php?tid=558657)
[HELP]Weapons after dead -
Mijata - 18.01.2015
how to create weapons after player dead
like it
Re: [HELP]Weapons after dead -
Ironboy - 18.01.2015
http://forum.sa-mp.com/showthread.ph...=weapon+pickup
http://forum.sa-mp.com/showthread.ph...=weapon+pickup
Re: [HELP]Weapons after dead -
Abagail - 18.01.2015
You can use OnPlayerDeath, along with CreateObject.
Example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(DoesPlayerHaveAnyGuns(playerid))
{
new Float: pos_x, Float: pos_y, Float: pos_z;
new weapons[13][2];
for (new i = 0; i <= 12; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
new weaponmodel = GetWeaponModelIDFromWeaponID(weapons[i]);
DroppedGuns[playerid][i] = CreateObject(weaponmodel, pos_x, pos_y, pos_z, 0.0, 0.0, 0.0);
}
}
return 1;
}
That's just an example(don't expect it to work at all, as it has undefined functions, and isn't representative of an actual code - it's just an example for you to get how you can accomplish this.