/escape command how add timer and fail? - 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: /escape command how add timer and fail? (
/showthread.php?tid=356301)
/escape command how add timer and fail? -
UserName31 - 03.07.2012
So i got this -->
PHP код:
dcmd_escape(playerid,params[])
{
#pragma unused params
new string[128];
new ID;
//Others
ResetPlayerWeapons(ID);
SendClientMessage(playerid,COLOR_RED,"[[_You Have Escaped From Jail!_]]");
SendClientMessage(playerid,COLOR_PINK,"A better /escape command");
SendClientMessage(playerid,COLOR_PINK,"Coming Soon!");
JailTime[ID] =1;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =1;
SetPlayerInterior(ID,10);
TogglePlayerControllable(ID,1);
SetPlayerWantedLevel(ID,6);
SetPlayerToTeamColour(ID);
return 1;
}
PHP код:
dcmd(escape,6,cmdtext);
it works and all but the problem is i can use it every time i want and i want to fail some of time please help if need any part of scrip just ask
Re: /escape command how add timer and fail? -
$$inSane - 03.07.2012
u should then have random cases on typing the command everytime
Re: /escape command how add timer and fail? -
Kindred - 03.07.2012
Not quite familiar with randoms, so don't go all up on my ass about this.
pawn Код:
dcmd_escape(playerid,params[])
{
#pragma unused params
new string[128];
new ID;
//Others
ResetPlayerWeapons(ID);
new rnd = random(4);
if(rnd == 1)
{
SendClientMessage(playerid,COLOR_RED,"[[_You Have Escaped From Jail!_]]");
SendClientMessage(playerid,COLOR_PINK,"A better /escape command");
SendClientMessage(playerid,COLOR_PINK,"Coming Soon!");
JailTime[ID] =1;
IsCuffed[ID] =0;
CuffTime[ID] =0;
TotalJailTime[ID] =1;
SetPlayerInterior(ID,10);
TogglePlayerControllable(ID,1);
SetPlayerWantedLevel(ID,6);
SetPlayerToTeamColour(ID);
}
return 1;
}
You can try something like that. I made it randomize 1-4, so, if I am correct, 25% of the time you escape, since it checks if the random became 1.
Re: /escape command how add timer and fail? -
UserName31 - 03.07.2012
lol how i never script a escape command but this is as hard as i script it
Re: /escape command how add timer and fail? -
UserName31 - 03.07.2012
sorry guy that misstake i was trying to do it with another recently rob lol but it dint work just ignore the random
all i ask is how to make fail timer
Thats and the random are also the jail positions i put it to random