SA-MP Forums Archive
help with commands jail - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with commands jail (/showthread.php?tid=100843)



help with commands jail - mr.b - 06.10.2009

hi i try make a jail command with dcmd but i have a problem with a timer

Quote:

new otherid,reason,time;

Quote:

dcmd(jail,4,cmdtext);

Quote:

dcmd_jail(playerid,params[]){
if(sscanf(params,"ddz",otherid,time,reason)) return SendClientMessage(playerid,0x33CCFFAA ,"USAGE: /jail [playerid] [time] [reason]");
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid,0xFF0000AA,"this player isnt conected!");
SetPlayerPos(arrestadoid,197.6661,173.8179,1003.02 34);
SetPlayerInterior(arrestadoid,3);
SetTimerEx("unjail",60000*time,false,"i",otherid);
return 1;
}

Quote:

forward unjail();
public unjail(){
SetPlayerPos(arrestadoid,2336.6738,2456.2771,14.96 8;
SetPlayerInterior(arrestadoid,0);
}

i have a problem with the timer it don't execute
how can fix it?
thaks


Re: help with commands jail - Jefff - 06.10.2009

Код:
dcmd_jail(playerid,params[]){
if(sscanf(params,"ddz",otherid,time,reason)) return SendClientMessage(playerid,0x33CCFFAA ,"USAGE: /jail [playerid] [time] [reason]");
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid,0xFF0000AA,"this player isnt conected!");
SetPlayerPos(otherid,197.6661,173.8179,1003.0234);
SetPlayerInterior(otherid,3);
SetTimerEx("unjail",60000*time,false,"i",otherid);
return 1;
}
Код:
forward unjail(playerid);
public unjail(playerid){
SetPlayerPos(playerid,2336.6738,2456.2771,14.9688);
SetPlayerInterior(playerid,0);
}



Re: help with commands jail - mr.b - 07.10.2009

donґt work the timer not unjail me


Re: help with commands jail - sandisk125 - 07.10.2009

try this:
pawn Код:
dcmd_jail(playerid,params[]){
if(sscanf(params,"ddz",otherid,time,reason)) return SendClientMessage(playerid,0x33CCFFAA ,"USAGE: /jail [playerid] [time] [reason]");
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid,0xFF0000AA,"this player isnt conected!");
SetPlayerPos(otherid,197.6661,173.8179,1003.0234);
SetPlayerInterior(otherid,3);
SetTimerEx("unjail",60000,false,"i",otherid);
return 1;
}

pawn Код:
forward unjail(playerid);
public unjail(playerid)
SetPlayerPos(playerid,2336.6738,2456.2771,14.9688);
SetPlayerInterior(playerid,0);
}



Re: help with commands jail - mr.b - 07.10.2009

ok it works but why this dont work SetTimerEx("unjail",time,false,"i",otherid);


Re: help with commands jail - sandisk125 - 07.10.2009

hmm
sorry i think i got confused because my time now is night...
okay so maybe try this:
pawn Код:
dcmd_jail(playerid,params[]){
if(sscanf(params,"ddz",otherid,time,reason)) return SendClientMessage(playerid,0x33CCFFAA ,"USAGE: /jail [playerid] [time] [reason]");
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid,0xFF0000AA,"this player isnt conected!");
SetPlayerPos(arrestadoid,197.6661,173.8179,1003.0234);
SetPlayerInterior(arrestadoid,3);
SetTimerEx("unjail",60000,false,"i",otherid);
return 1;
}


pawn Код:
forward unjail(arrestadoid);
public unjail(arrestadoid)
SetPlayerPos(arrestadoid,2336.6738,2456.2771,14.9688);
SetPlayerInterior(arrestadoid,0);
}

i hope this code works!




Re: help with commands jail - mr.b - 07.10.2009

yea the timer works now but i want a player can set the time in the jail for the other player