SA-MP Forums Archive
Goldpot minigame - Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Goldpot minigame - Help (/showthread.php?tid=230313)



Goldpot minigame - Help - [MWR]Blood - 23.02.2011

Hey guys, I'm attempting to create a goldpot minigame.
Here's my code:
pawn Код:
stock StartGoldpot(pickupid,type,Float:x,Float:y,Float:z,rewardcash,rewardscore,hint[])
{
new string[128];
goldpot = CreatePickup(pickupid,type,x,y,z);
format(string,sizeof(string),"A goldpot has started! Worth $%d and %d score! Hint: %s",rewardcash,rewardscore,hint);
SendClientMessageToAll(orange,string);
return 1;
}

stock WinGoldpot(playerid,rewardcash,rewardscore)
{
new string[128];
new winner[MAX_PLAYER_NAME];
GetPlayerName(playerid,winner,sizeof(winner));
DestroyPickup(goldpot);
GivePlayerMoney(playerid,rewardcash);
SetPlayerScore(GetPlayerScore(playerid)+rewardscore);
return 1;
}
forward Goldpot(playerid);
public Goldpot(playerid)
{
switch (random(4))
{
case 1:{ StartGoldpot(1276,20,-1784.7592,1309.8893,59.7344,100000,3,"Otto parking lot");}
case 2:{StartGoldpot(1276,20,-1969.1941,708.3779,47.9662,150000,5,"Zombotech");}
case 3:{StartGoldpot(1276,20,2061.8364,-1832.0338,13.5469,50000,1,"LS Spray Shop");}
case 4:{StartGoldpot(1276,20,1876.4324,-1625.3966,13.4327,20000,1,"Let's go disco!");}
}
return 1;
}
This part does work, but I'm stuck on the onplayerpickuppickup code.
I can't figure out how to define the different goldpots.
I tried with some variables, doesn't work.
Any ideas?
Thanks in advance!


Re: Goldpot minigame - Help - YungGee - 23.02.2011

Make stock StartGoldpot into stock StartGoldpot1 / stock StartGoldpot2 / stock StartGoldpot3 etc thus creating/destroying individual pickups?