Making players having to wait SOME TIME before moving to NEXT STEPS
#1

Alright,i can say that i'm not good with timing,thats why i'm posting this..
This might be easy for some of you guys..
its like ,the script should read ,You need to wait 30Seconds before moving to next step
I'm making a bank robbery systeme,and thats why.. they need to wait 30secs,before it gives them next informations
the problem,is which function you guys think i should use?
Reply
#2

SetTimer or SetTimerEx.
Reply
#3

Quote:
Originally Posted by Fj0rtizFredde
Посмотреть сообщение
I Know,that but is just like:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/Robbery", true))
    {
    GameTextForPlayer(playerid, "~Y~You are Attempting to ~r~ Hack ~y~ Bank Door ~n~ ~g~ You have to wait...", 30000, 5);
    SetTimer(Robtime, 30000, false);
    return 1;
}
    return 0;
}
and
pawn Код:
Forward Robtime();
?
Reply
#4

You mean something like this?
pawn Код:
forward RobTimer(playerid);
public OnPlayerCommandText(playerid, cmdtext[])
{    
    if(!strcmp(cmdtext, "/Robbery", true))    
    {    
        GameTextForPlayer(playerid, "~Y~You are Attempting to ~r~ Hack ~y~ Bank Door ~n~ ~g~ You have to wait...", 30000, 5);    
        TogglePlayerControllable(playerid,0); //Freeze the player or do what ever you want to do..
        SetTimerEx("RobTimer", 30000, false, "i", playerid);  
        return 1;
    }    
    return 0;
}
public RobTimer(playerid)
{
    TogglePlayerControllable(playerid,1);
    SendClientMessage(playerid,-1,"Run before the cops comes!");
    GivePlayerMoney(playerid,100000);
    return 1;
}
Reply
#5

PHP код:
// At the top of your script
forward Robbery(playerid);
// OnPlayerCommandText
if(!strcmp(cmdtext"/robbery"true))
{
    
GameTextForPlayer(playerid"~Y~You are Attempting to ~r~ Hack ~y~ Bank Door ~n~ ~g~ You have to wait..."300005);
    
SetTimer("Robbery" ,30000 ,0);
    return 
1;
}
// At the end of the script
public Robbery(playerid)
{
   
// NEXT STEP
   
return 1;

EDIT: Or use Fj0rtizFredde's code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)