Help Give REP
#1

When i try to do my /punish command i got an error

Код:
command(punish, playerid, params)
{
	if(SInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, ROJO, "Command Not Found on GTACNR Use /cmds or /commands.!");
	else
	{
	    new ID, reason[100];
	    if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /punish [id] [reason]");
	    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
	    else
	    {
	        new string[256], name[60], name2[60];
	        GetPlayerName(playerid, name, 60);
	        GetPlayerName(ID, name2, 60);
			SetPlayerInterior(playerid, 7);
			SetPlayerPos(playerid,298.507934,-141.647048,1004.054748);
	        format(string, 256, "****ADMIN PUNISH :%s[%d].Has Been Send to Punish Room From The Server (Reason: %s)", name, playerid, name2, ID, reason);
	        SendClientMessageToAll(CELESTE, string);
		}
	}
	return 1;
}
error

error 035: argument type mismatch (argument 1)
Reply
#2

error EDIT:
pawn Код:
command(punish, playerid, params[])
{
    if(SInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, ROJO, "Command Not Found on GTACNR Use /cmds or /commands.!");
    else
    {
        new ID, reason[100];
        if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /punish [id] [reason]");
        else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
        else
        {
            new string[256], name[60], name2[60];
            GetPlayerName(playerid, name, 60);
            GetPlayerName(ID, name2, 60);
            SetPlayerInterior(playerid, 7);
            SetPlayerPos(playerid,298.507934,-141.647048,1004.054748);
            format(string, 256, "****ADMIN PUNISH :%s[%d].Has Been Send to Punish Room From The Server (Reason: %s)", name, playerid, name2, ID, reason);
            SendClientMessageToAll(CELESTE, string);
        }
    }
    return 1;
}
Reply
#3

seems like the error is coming right here

pawn Код:
if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /punish [id] [reason]");
base on my information
Reply
#4

Quote:
Originally Posted by eesh
Посмотреть сообщение
error EDIT:
pawn Код:
command(punish, playerid, params[])
{
    if(SInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, ROJO, "Command Not Found on GTACNR Use /cmds or /commands.!");
    else
    {
        new ID, reason[100];
        if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /punish [id] [reason]");
        else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
        else
        {
            new string[256], name[60], name2[60];
            GetPlayerName(playerid, name, 60);
            GetPlayerName(ID, name2, 60);
            SetPlayerInterior(playerid, 7);
            SetPlayerPos(playerid,298.507934,-141.647048,1004.054748);
            format(string, 256, "****ADMIN PUNISH :%s[%d].Has Been Send to Punish Room From The Server (Reason: %s)", name, playerid, name2, ID, reason);
            SendClientMessageToAll(CELESTE, string);
        }
    }
    return 1;
}
Thnx It worked Repped

What was the problem ? params?
Reply
#5

oh i forgot to look at that params

your error was here

Код:
params
it must be

Код:
params[]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)