Cash 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cash Pickup (
/showthread.php?tid=79874)
Cash Pickup -
Puzi - 31.05.2009
Hi there,
I would want to do a cash pickup that if you go into it, it gives you $500 but every 10 minutes. Is it possible?
Thank You and Regards
Puzi
Re: Cash Pickup -
Correlli - 31.05.2009
Make a timer, use
OnPlayerPickUpPickup.
And this is pickupid for money pickup.
Quote:
Originally Posted by wiki.sa-mp.com
1212 - money packet
|
Re: Cash Pickup -
Luka P. - 31.05.2009
pawn Код:
new moneypickup = CreatePickup(bla bla);
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == moneypickup){GivePlayerMoney(playerid,amount);}
return 1;
}
Re: Cash Pickup -
Correlli - 31.05.2009
There is no timer in your code. He mentioned a 10 minutes timer.
Re: Cash Pickup -
Luka P. - 31.05.2009
Oh,i forgot.
pawn Код:
forward MoneyTimer(playerid);
pawn Код:
new moneypickup = CreatePickup(bla bla);
new used[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
used[playerid] = 0;
return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
if(pickupid == moneypickup)
{
if(used[playerid] == 0)
{
GivePlayerMoney(playerid,amount);
used[playerid] = 1;
SetTimerEx("MoneyTimer",600000,0,"i",playerid);
}
}
return 1;
}
pawn Код:
public MoneyTimer(playerid)
{
used[playerid] = 0;
return 1;
}