help in Pickup
#1

how to add Pickup when kill other team?

pickup armour or health!
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)