SA-MP Forums Archive
Jail CMD - 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: Jail CMD (/showthread.php?tid=523890)



Jail CMD - SHE790 - 04.07.2014

Hi all i have a problem with this jail cmd
Код:
CMD:jail(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 1) return SendClientMessage(playerid,COL_RED,"You need to be admin");
   new
      string[256],reason[100],pplayerid,time;
      if(sscanf(params,"uis[50]", pplayerid,reason)) return SendClientMessage(playerid,-1,"USAGE:/jail [playerid] [time] [reason]");
      if(pplayerid==INVALID_PLAYER_ID) return SendClientMessage(playerid,COL_RED,"Player Id Not Connected");
      if(P_Data[playerid][pAdmin]  == 1) return SendClientMessage(playerid,COL_RED,"You CAN'T jail Admins");
      format(string,sizeof(string),"Admin %s Has Jailed %s Reason: %s",GetName(playerid),GetName(pplayerid),reason);
      SendClientMessageToAll(-1,string);
      Jailed(pplayerid);
    SetPlayerInterior(pplayerid, 6);
   return 1;
}
Код:
Errors:
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(420) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(424) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(425) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(428) : error 012: invalid function call, not a valid address
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(428) : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(428) : error 001: expected token: ";", but found ")"
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(428) : error 029: invalid expression, assumed zero
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(428) : fatal error 107: too many error messages on one line
Код:
Error Lines:
(420):    if(P_Data[playerid][pAdmin] == 1) return SendClientMessage(playerid,COL_RED,"You need to be admin");
(424):    if(pplayerid==INVALID_PLAYER_ID) return SendClientMessage(playerid,COL_RED,"Player Id Not Connected");
(425):    if(P_Data[playerid][pAdmin]  == 1) return SendClientMessage(playerid,COL_RED,"You CAN'T jail Admins");
(428):    Jailed(pplayerid);



Re: Jail CMD - Dziugsas - 04.07.2014

Where is your "time" paramater and local variable?


Re: Jail CMD - SHE790 - 04.07.2014

Quote:
Originally Posted by Dziugsas
Посмотреть сообщение
Where is your "time" paramater and local variable?
SetPlayerInterior(pplayerid, 6);


Re: Jail CMD - Sawalha - 04.07.2014

He meant time, not jail position,
/jail pplayerid minutes(time) reason


Re: Jail CMD - SHE790 - 04.07.2014

Any one?


AW: Jail CMD - Macronix - 04.07.2014

pawn Код:
if(sscanf(params, "us[50]", pplayerid, reason)) return SendClientMessage(playerid,-1,"USAGE:/jail [playerid] [time] [reason]");
You missed a comma after "params"
And can you show me your Player enum?


Re: Jail CMD - Dziugsas - 04.07.2014

First of all your missing time paramater.

new time;
if(sscanf(params"uis[50]", pplayerid,time,reason)) return SendClientMessage(playerid,-1,"USAGE:/jail [playerid] [time] [reason]");


Re: Jail CMD - SHE790 - 04.07.2014

Ok done but still errors
Код:
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(416) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : error 001: expected token: ",", but found "-string-"
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : error 001: expected token: ";", but found ")"
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : error 029: invalid expression, assumed zero
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(419) : fatal error 107: too many error messages on one line



AW: Jail CMD - Macronix - 04.07.2014

Here, try this:

pawn Код:
CMD:jail(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 1) return SendClientMessage(playerid,COL_RED,"You need to be admin");
   new
      string[256],reason[100],pplayerid;
      if(sscanf(params,"us[50]", pplayerid,reason)) return SendClientMessage(playerid,-1,"USAGE:/jail [playerid] [time] [reason]");
      if(pplayerid==INVALID_PLAYER_ID) return SendClientMessage(playerid,COL_RED,"Player Id Not Connected");
      if(P_Data[playerid][pAdmin]  == 1) return SendClientMessage(playerid,COL_RED,"You CAN'T jail Admins");
      format(string,sizeof(string),"Admin %s Has Jailed %s Reason: %s",GetName(playerid),GetName(pplayerid),reason);
      SendClientMessageToAll(-1,string);
      Jail(pplayerid);
    SetPlayerInterior(pplayerid, 6);
   return 1;
}
You got several comma mistakes..


Re: Jail CMD - SHE790 - 04.07.2014

-__-
Quote:

C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 20) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 24) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 25) : error 035: argument type mismatch (argument 2)
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 2 : error 012: invalid function call, not a valid address
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 2 : warning 215: expression has no effect
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 2 : error 001: expected token: ";", but found ")"
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 2 : error 029: invalid expression, assumed zero
C:\Users\Golchin Rayaneh\Desktop\ServeR\filterscripts\ShAdmin.pwn(4 2 : fatal error 107: too many error messages on one line