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



-.- prob again - dark_clown - 28.10.2010

help me out
Код:
dcmd_jail(playerid,params[])
{
    new id,string[128],time[64],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, "iss", 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,"d",id);
	return 1;
}
error
Код:
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.
error line
Quote:

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




Re: -.- prob again - DeathOnaStick - 28.10.2010

Quote:
Originally Posted by dark_clown
Посмотреть сообщение
help me out
Код:
dcmd_jail(playerid,params[])
{
    new id,string[128],time[64],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, "iss", 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,"d",id);
	return 1;
}
error
Код:
C:\Users\mike\Desktop\server\filterscripts\dadmin.pwn(846) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.
error line
pawn Код:
if(sscanf(params, "iss", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
should be
pawn Код:
if(sscanf(params, "iis", id,time,reason)) return SendClientMessage(playerid,red,"USAGE: /jail [playerid] [time] [reason]");
If it gives you errors, use this:
pawn Код:
SetTimerEx("jailtimer",strval(time),false,"d",id);



Re: -.- prob again - dark_clown - 28.10.2010

ohai DeathOnaStick thanks for u help this time
gonna test it
kthxbai