Sends error message?
#1

When I do this command in-game it says my error message, not server : unknown error

pawn Code:
COMMAND:color_green(playerid, params[])
   {
       SetPlayerColor(playerid, 0x33AA33AA);
       SendClientMessage(playerid, 0x33AA33AA, "Your Name Has Changed To Green");
       return 1;
   }
Reply
#2

Code:
COMMAND:color_green(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		SetPlayerColor(playerid, 0x33AA33AA);
		SendClientMessage(playerid, 0x33AA33AA, "Your Name Has Changed To Green");
	}
	return 1;
}
Try this
Reply
#3

The code is wrong.it's not going to work with _ in the command.

Code:
COMMAND:colorgreen(playerid, params[])
{
    SetPlayerColor(playerid, 0x33AA33AA);
    SendClientMessage(playerid, 0x33AA33AA, "Your Name Has Changed To Green");
    return 1;
}
Do /colorgreen (ingame)
Reply
#4

Quote:
Originally Posted by DerickClark
View Post
The code is wrong.it's not going to work with _ in the command.

Code:
COMMAND:colorgreen(playerid, params[])
{
    SetPlayerColor(playerid, 0x33AA33AA);
    SendClientMessage(playerid, 0x33AA33AA, "Your Name Has Changed To Green");
    return 1;
}
Do /colorgreen (ingame)
Oh thats why. Thanks but is there any way to do like /color green other than Onplayercommandtext?
Reply
#5

You can't.i think maybe you can.
Reply
#6

Quote:
Originally Posted by Affan
View Post
Oh thats why. Thanks but is there any way to do like /color green other than Onplayercommandtext?
You can use

pawn Code:
CMD:color(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, 0xCC0000AA, "Valid colors: green, red, blue");

    new tmp[10];
    if(!strcmp(params, "green", true))
    {
        SetPlayerColor(playerid, 0x33AA33AA);
        tmp="green";
    }
    else if(!strcmp(params, "red", true))
    {
        SetPlayerColor(playerid, 0xFF0000AA);
        tmp="red";
    }
    else if(!strcmp(params, "blue", true))
    {
        SetPlayerColor(playerid, 0x0000FFAA);
        tmp="blue";
    }
    //and so on
   
    new string[100];
    format(string, sizeof(string), "You set your color to %s", tmp);
    SendClientMessage(playerid, 0xCCCC00AA, string);
    return 1;
}
Reply
#7

@[ABK]Antonio: Thank you very much. +repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)