Pickup Coffin - 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: Pickup Coffin (
/showthread.php?tid=375376)
Pickup Coffin -
kbalor - 06.09.2012
I need help. Is it possible to GivePlayerMoney and show GameTextForPlayer ONLY for players who picks the Pickup except the Victim or his own Tombstone.
I mean, If I killed myself or killed by someone and then If I picked my own Tombstone then show nothing and don't give money. So people would not abuse killing themselves just to make money.
If someone pick the tombstone (except me) then destroy the tombstone +give him $400.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pickupid == tombstonePickups[i])
{
new tombstring[MAX_PLAYER_NAME+20];
GetPlayerName(i,tombstring,MAX_PLAYER_NAME);
strins(tombstring, "~g~+$400 ~n~~r~Coffin of:~n~~w~", 0);
GameTextForPlayer(playerid,tombstring,3000,3);
DestroyPickup(tombstonePickups[playerid]);
tombstonePickups[playerid] = -1;
GivePlayerMoney(playerid, 400);
break;
}
}
return 1;
}
Re: Pickup Coffin -
mobiliz - 06.09.2012
Why don't you do like if you die you get -$1000?, So others can pickup there own coffin but they wont get much of there money back?
Re: Pickup Coffin -
kbalor - 06.09.2012
Quote:
Originally Posted by mobiliz
Why don't you do like if you die you get -$1000?, So others can pickup there own coffin but they wont get much of there money back?
|
Yes good idea! But my gamemode is Freeroam. People use vehicles then use boost and go in a huge ramps then pressing F (Splat) and some other cases related to Suicide. I don't want to waste their money just doing that.
and Additional If someone pick my tombstone it doesnt destroy. But if it was my tombstone it destroy why?