help with commands jail
#1

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
Reply
#2

Код:
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);
}
Reply
#3

donґt work the timer not unjail me
Reply
#4

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);
}
Reply
#5

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

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!

Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)