SA-MP Forums Archive
timer prob - 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: timer prob (/showthread.php?tid=186315)



timer prob - dark_clown - 28.10.2010

humm why dosnt this work?
Код:
dcmd_jail(playerid,params[])
{
    new id,string[128],time,pName[MAX_PLAYER_NAME],mName[MAX_PLAYER_NAME],reason[100];
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,"ERROR: You must be level 3");
        
    if(sscanf(params, "is[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
    PInfo[id][Jailed] = 1;
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);GetPlayerName(id, mName, MAX_PLAYER_NAME);
    format(string,sizeof string,"||Administrator %s jailed %s [%i min's] [reason: %s]||",pName,mName,time,reason);
    SendClientMessageToAll(red,string);
    format(string, sizeof(string), "MyAdmin/Users/%s.ini", mName);
	dini_IntSet(string,"Jailed",1);
	SendClientMessage(id,red,"You are now still in jail");
	PutPlayerInJail(id);
	SetTimerEx("jailtimer", time, false, "i",id");
	return 1;
}
error line
Quote:

SetTimerEx("jailtimer", time, false, "i",id");

errors
Код:
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 037: invalid string (possibly non-terminated string)
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : warning 215: expression has no effect
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 001: expected token: ";", but found ")"
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 029: invalid expression, assumed zero
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
4 Errors.
iv never used settimerex before just trying it for sumthin


Re: timer prob - DeathOnaStick - 28.10.2010

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
humm why dosnt this work?
Код:
dcmd_jail(playerid,params[])
{
    new id,string[128],time,pName[MAX_PLAYER_NAME],mName[MAX_PLAYER_NAME],reason[100];
    if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,"ERROR: You must be level 3");
        
    if(sscanf(params, "is[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
    PInfo[id][Jailed] = 1;
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);GetPlayerName(id, mName, MAX_PLAYER_NAME);
    format(string,sizeof string,"||Administrator %s jailed %s [%i min's] [reason: %s]||",pName,mName,time,reason);
    SendClientMessageToAll(red,string);
    format(string, sizeof(string), "MyAdmin/Users/%s.ini", mName);
	dini_IntSet(string,"Jailed",1);
	SendClientMessage(id,red,"You are now still in jail");
	PutPlayerInJail(id);
	SetTimerEx("jailtimer", time, false, "i",id");
	return 1;
}
error line

errors
Код:
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 037: invalid string (possibly non-terminated string)
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : warning 215: expression has no effect
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 001: expected token: ";", but found ")"
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 029: invalid expression, assumed zero
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
4 Errors.
iv never used settimerex before just trying it for sumthin
pawn Код:
if(sscanf(params, "is[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
Should be:
pawn Код:
if(sscanf(params, "iis[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
You made 'time' a string and left out 'reason'.

[gay]This forum requires that you wait 120 seconds between posts. Please try again in 12 seconds.[/gay]


Re: timer prob - dark_clown - 28.10.2010

Quote:
Originally Posted by DeathOnaStick
Посмотреть сообщение
pawn Код:
if(sscanf(params, "is[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
Should be:
pawn Код:
if(sscanf(params, "iis[100]", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
You made 'time' a string and left out 'reason'.

[gay]This forum requires that you wait 120 seconds between posts. Please try again in 12 seconds.[/gay]
lol i saw that after i fixed it my self, but still thanks