SA-MP Forums Archive
Making players having to wait SOME TIME before moving to NEXT STEPS - 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)
+--- Thread: Making players having to wait SOME TIME before moving to NEXT STEPS (/showthread.php?tid=288200)



Making players having to wait SOME TIME before moving to NEXT STEPS - Issam - 06.10.2011

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?



Re: Making players having to wait SOME TIME before moving to NEXT STEPS - Fj0rtizFredde - 06.10.2011

SetTimer or SetTimerEx.


Re: Making players having to wait SOME TIME before moving to NEXT STEPS - Issam - 06.10.2011

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();
?


Re: Making players having to wait SOME TIME before moving to NEXT STEPS - Fj0rtizFredde - 06.10.2011

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;
}



Re: Making players having to wait SOME TIME before moving to NEXT STEPS - Coudio - 06.10.2011

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