Help with death 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 with death pickup (
/showthread.php?tid=657511)
Help with death pickup -
,TomY' - 09.08.2018
Hello. How to create pickup after player death in that position, where player died? I know how to get players position, but whats next? I need to create pickups after every death. Also I need, that when other player enter that pickup, he get money or just text and that pickup destroy.
Re: Help with death pickup -
,TomY' - 09.08.2018
any help?
Re: Help with death pickup -
DAKYSKYE - 12.08.2018
I will write an example which has to be optimized, I hope you will do that.
PHP код:
new DeathPickup[MAX_PLAYERS];
public OnPlayerDeath(playerid)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
DeathPickup[playerid] = CreatePickup(model, type, x, y, z, virtualworld);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(pickupid = DeathPickup[i]) {
SendClientMessage(playerid, -1, "You have just entered in pickup where someone died !");
GivePlayerMoney(playerid, 80);
GameTextForPlayer(playerid, "80$+", 1000, 2);
DestroyPickup(DeathPickup[i]);
}
}
return 1;
}
I will be gratefull if you + my reputation (in case if I helped you).