SA-MP Forums Archive
Help Give REP - 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: Help Give REP (/showthread.php?tid=331252)



Help Give REP - Chris1337 - 04.04.2012

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)


Re: Help Give REP - eesh - 04.04.2012

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;
}



Re: Help Give REP - Reklez - 04.04.2012

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


Respuesta: Re: Help Give REP - Chris1337 - 04.04.2012

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?


Re: Help Give REP - Reklez - 04.04.2012

oh i forgot to look at that params

your error was here

Код:
params
it must be

Код:
params[]