CMD:/dcolor(playerid, params[]) { if(PlayerInfo[playerid][dRank] >= 1) { SendClientMessage(playerid, red, "USAGE: /dcolour [yourID] [Colour]"); return SendClientMessage(playerid, red, "Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink"); } else return SendClientMessage(playerid,red,"ERROR: You need to be atleast Donor level 2 to use this command"); format(string, sizeof(string), "You have set your colour to '%s' ", colour);
CMD:dcolor(playerid, params[])
{
if(PlayerInfo[playerid][dRank] >= 1)
{
if(isnull(params))
{
SendClientMessage(playerid, COLOR,"USAGE: /setcolor <0 - 9>");
SendClientMessage(playerid, COLOR,"blabla");
}
//
if(!strcmp(params, "0", true)) // if he have 0 after /dcolor 0
{
SetPlayerColor(playerid, COLOR);
SendClientMessage(playerid, COLOR, "white");
return 1;
}
// do like the 1 one
}
else
{
SendClientMessage(playerid,red,"ERROR: You need to be atleast Donor level 2 to use this command");
}
return 1;
}
CMD:dcolor(playerid, params[])
{
if(PlayerInfo[playerid][dRank] < 1) return SendClientMessage(playerid, red, "[Error] You are not authorised to use this command.");
else
{
new string[84],
id,
color,
name[MAX_PLAYER_NAME+1];
if(sscanf(params, "ud", id, color))
{
SendClientMessage(playerid, red, "[Usage] /dcolor [Player ID] [Color ID]");
SendClientMessage(playerid, white, "[Info] Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink");
return 1;
}
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "[SUCCESS] You have set %s's color to %d.", name, color);
SendClientMessage(playerid, white, string);
SetPlayerColor(id, color);
}
return 1;
}
CMD:dcolor(playerid, params[])
{
if(PlayerInfo[playerid][dRank] < 1) return SendClientMessage(playerid, red, "[Error] You are not authorised to use this command.");
else
{
new string[84],
color;
if(sscanf(params, "d", color))
{
SendClientMessage(playerid, white, "[Usage] /dcolor [Color ID]");
SendClientMessage(playerid, white, "[Info] Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink");
return 1;
}
format(string, sizeof(string), "[SUCCESS] You set your color to %d.", color);
SendClientMessage(playerid, white, string);
SetPlayerColor(playerid, color);
}
return 1;
}
Oops, I didn't get you right.
I thought you wanted him to be able to set everyone's color, so that's what the command I posted above does. But here you go, I made you a new command, using this he will only be able to set his own color. PHP код:
|
switch( color )
{
case 0: SetPlayerColor(playerid, 0x000000FF);
case 1: SetPlayerColor(playerid, 0xFFFFFFFF);
case 2: SetPlayerColor(playerid, 0xFF0000FF);
case 3: SetPlayerColor(playerid, /* orange here */);
case 4: SetPlayerColor(playerid, 0xFFFF00FF);
case 5: SetPlayerColor(playerid, 0x00FF00FF);
case 6: SetPlayerColor(playerid, 0x0000FFFF);
case 7: SetPlayerColor(playerid, /* purple here */);
case 8: SetPlayerColor(playerid, /* brown here */);
case 9: SetPlayerColor(playerid, /* pink here */);
}