Jail CMD
#1

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

Where is your "time" paramater and local variable?
Reply
#3

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

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

Any one?
Reply
#6

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

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]");
Reply
#8

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

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..
Reply
#10

-__-
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

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)