SA-MP Forums Archive
help in Pickup - 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 in Pickup (/showthread.php?tid=357437)



help in Pickup - kings24 - 07.07.2012

how to add Pickup when kill other team?

pickup armour or health!


Re: help in Pickup - Jarnu - 07.07.2012

pawn Код:
new health;
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[playerid] != gTeam[killerid])
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y,Z);
health = CreatePickup(1240, 2, X,Y,Z, -1);
}
else return SendClientMessage(killerid, COLOR_RED,"You have Killed your Own Team Mate!"); //your wish you want to add this line or not.
}
Now OnPlayerPickUpPickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == health)
{
SendClientMessage(playerid, COLOR_GREEN,"Good Job you have killed your enemy and spawned health pickup!");
SetPlayerHealth(playerid, 100.0);
DestroyPickup(health);
}
return 1;
}
Regards,
Jarnu.