i don't understand settimer
#1

hello together,

I would like to know how I
a pickup where you get money so that you set again only after 30 seconds gets money
Reply
#2

Okay,

Put this ON TOP of your script:
pawn Код:
new given[MAX_PLAYERS];
Put this under: OnGameModeInt
pawn Код:
moneys=CreatePickup(1274,1,2057.29, 1531.57, 10.67);
//The pickup (change the coords if you want) Its infront of ship (LV)
This under OnPlayerPickupPickup
pawn Код:
{
    if(pickupid == import)
        {
if(given[playerid]==1) return SendClientMessage(playerid, 0xFF0000AA, "Come back in 30 seconds!"); // if he got it already it returns

        SendClientMessage(playerid, 0x0A8F00FF, "You became 5000$! Come back in 30 seconds to get another 5000$.");
        GivePlayerMoney(playerid, 5000); // Gives him 5000
        given[playerid]=1;  // let the system know that he got it
        SetTimerEx("MGiver",30000,0,"d",playerid); // starts the 30 sec timer
}
In the end of your script:

pawn Код:
forward MGiver(playerid);
public MGiver(playerid)
{
    given[playerid]=0; // now he can enter again
}
This is untested, but it should work.
Would be nice if you say me if this was good.

Jeffry
Reply
#3

what ?

can you make it easyier
id dont understand that ?

i make it and come error
Reply
#4

Код:
{
	if(pickupid == import)
		{
if(given[playerid]==1) return SendClientMessage(playerid, 0xFF0000AA, "Come back in 30 seconds!"); // if he got it already it returns
else
	SendClientMessage(playerid, 0x0A8F00FF, "You became 5000$! Come back in 30 seconds to get another 5000$.");
	GivePlayerMoney(playerid, 5000); // Gives him 5000
     given[playerid]=1;  // let the system know that he got it
     SetTimerEx("MGiver",30000,0,"d",playerid); // starts the 30 sec timer
}
Reply
#5

without forward or so

only copy and paste im beginner

sorry
Reply
#6

(dn)eagle im sorry its functionaly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)