SA-MP Forums Archive
Hi Help me. - 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: Hi Help me. (/showthread.php?tid=604147)



Hi Help me. - RedRex - 01.04.2016

Hi Guys How to I can Set Timer When Player Robbed Casino or ammu or something? Plesae Help me.


Re: Hi Help me. - Sithis - 01.04.2016

With SetTimer. Check the wiki!


Re: Hi Help me. - FernandoLight - 01.04.2016

Check out this page; https://sampwiki.blast.hk/wiki/SetTimer


Re: Hi Help me. - Vanter - 01.04.2016

there's the whole thing
http://lmgtfy.com/?q=how+to+set+a+ti...ting+please%3F


Re: Hi Help me. - introzen - 01.04.2016

Read the forum rules before posting. Your subject is way out of line and does not in any way describe what you want help with.


Re: Hi Help me. - RedRex - 01.04.2016

guys I mean Timer When Robbing Any Shop Or Casino ......
as this


Код:
CMD:robdrag(playerid, params[])
{
	if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
	if(IsRobbingDrag{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
	if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer20]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer20] = gettime();
	new chance = random(3);
	if(chance == 0)
	{
	    format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the 4 Dragons Casino.");
	    GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 5);
	}
	else if(IsPlayerInRangeOfPoint(playerid,1.0,1955.3691,1018.0455,992.4688))
    {
	    if((gettime() - 120) < dragrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing 4 Dragons Casino, DON'T LEAVE THE CHECKPOINT!");
	    GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 150000, 10);
	    SetTimer("robtimer", 30000, false);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingDrag{playerid} = true;
        dragtimer{playerid} = SetTimerEx("DragRob", 150000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        dragrobbed = gettime(10);
	}
	else
	{
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
	}
	new astring[100],pName[24];
	GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robdrag",pName,playerid);
    SendAdminMessage(GREY,astring);
	return true;
}
How to I can add TIMER When Player Robbed?


Re: Hi Help me. - RedRex - 01.04.2016

Guys I mean When Player Robbing Saw him a Timer

Show this

Код:
CMD:robdrag(playerid, params[])
{
	if(GetTeam{playerid} != CLASS_CIV) return SendClientMessage(playerid, RED, "Only civilians can rob places.");
	if(IsRobbingDrag{playerid} == true) return SendClientMessage(playerid, RED, "Your already robbing the joint.");
	if(IsPlayerHoldingAGun(playerid) == 0 || HasBeenCuffed{playerid} == true) return SendClientMessage(playerid, RED, "You must be holding a gun to rob places.");
    if((gettime() - 120) < TimerInfo[playerid][CMD_timer20]) return SendClientMessage(playerid, RED, "Please wait before using this command again.");
    TimerInfo[playerid][CMD_timer20] = gettime();
	new chance = random(3);
	if(chance == 0)
	{
	    format(fstr, sizeof(fstr),  "[DISPATCH]: Suspect %s [%d] has attempted to rob the 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, RED, "You have failed to rob the 4 Dragons Casino.");
	    GameTextForPlayer(playerid, "~w~Robbery ~r~Failed", 5000, 5);
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 5);
	}
	else if(IsPlayerInRangeOfPoint(playerid,1.0,1955.3691,1018.0455,992.4688))
    {
	    if((gettime() - 120) < dragrobbed) return SendClientMessage(playerid, RED, "This place has been robbed recently, try again later.");
        format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s [%d] is now robbing 4 Dragons Casino at The New Vegas Strip[South]", GetName(playerid), playerid);
        CopRadio(BLUE, fstr);
        SendClientMessage(playerid, LIGHTGREEN, "Your robbing 4 Dragons Casino, DON'T LEAVE THE CHECKPOINT!");
	    GameTextForPlayer(playerid, "~r~Holdup ~w~In ~g~Progress...~n~~r~Dont Leave ~w~The ~r~Checkpoint.", 150000, 10);
        SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid)+6);
        IsRobbingDrag{playerid} = true;
        dragtimer{playerid} = SetTimerEx("DragRob", 150000, false, "d", playerid);
        ApplyAnimation(playerid,"ped","ARRESTgun",4.1,0,1,1,1,1);
        dragrobbed = gettime(10);
	}
	else
	{
        SendClientMessage(playerid, RED, "Your not at the robbery checkpoint.");
	}
	new astring[100],pName[24];
	GetPlayerName(playerid,(pName),sizeof(pName));
    format(astring,sizeof(astring),"%s [%d] typed: /robdrag",pName,playerid);
    SendAdminMessage(GREY,astring);
	return true;
}
The Player Didn't take the Timer When Rob