17.06.2014, 01:45
How to make it so it says
- " 10 seconds left"
- " 9 seconds left"
- " 8 seconds left"
- and on and on.
Cause i made a robbery script (help from a tutorial on samp forums) and i need it cause it seems wierd when you /robstore and you stand there for 15 seconds with no gametext informing you how many seconds you have to wait to finish robbing it.
Dont mind the comments cause it was a tutorial xD, but heres the script:
and the timer:
I would really appreciate if you helped.
- " 10 seconds left"
- " 9 seconds left"
- " 8 seconds left"
- and on and on.
Cause i made a robbery script (help from a tutorial on samp forums) and i need it cause it seems wierd when you /robstore and you stand there for 15 seconds with no gametext informing you how many seconds you have to wait to finish robbing it.
Dont mind the comments cause it was a tutorial xD, but heres the script:
pawn Код:
CMD:robstore(playerid, params[])
{
if(robpossible == 1) //If the bank can be robbed we continue below
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 374.8841,-118.8026,1001.4995))
{//Next thing we do is, we check if we are at the bank interior ^^
robpossible = 0; //Then we set the bank so it cannot be robbed
SetTimer("waittimer", 900000, false); //Normal Mode 5 minutes
/*We run the timer(5 minutes) for the function that is going to make the
bank available for robbing again
*/
//SetTimer("waittimer", 65000, false); //Test Mode 65 seconds
SetTimer("robtimer", 15000, false);
/* We also run another timer(1 minute) for the function that is
actually going to give us the money and a user friendly message.
*/
/*
Add a function that would notify the police.
*/
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}You are now Robbing {EAEA15}Well Stacked Pizza.");
GameTextForPlayer(playerid,"~Y~ROBBERY STARTED",3000,3);
SendClientMessage(playerid, COLOR_WHITE, "{1A94E6}You gotta stay here for 15 seconds.");
}
} else {
SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
}
return 1;
}
pawn Код:
public robtimer(playerid)
{
new string[256];//We are defining a new string for the formatted message that we are displaying later on.
new cash = random(90000);
GivePlayerMoney(playerid, cash);
/*
With the fuction above 'new cash = random(200000);
GivePlayerMoney(playerid, cash);' we give the player
a random amount of money from $0 - $200,000
*/
//Here below we use the string we defined above to format the message itself and display it to the player.
format(string, sizeof(string), "{FF3300}You have successfully robbed {09F720}$%d {FF3300}from Well Stacked Pizza!", cash);
SendClientMessage(playerid, COLOR_WHITE, string);
new pname[126];
GetPlayerName(playerid,pname,sizeof(pname));
format(string, 256, "{33CCBD}%s has robbed $%d from Well Stacked Pizza in Idlewood.",pname,cash);
SendClientMessageToAll( 0x48ACB7C8, string );
}