25.06.2009, 16:15
Okay i have this /me command
But how to i send message to everybody in the players Team color? like if they are TEAM_CITIZEN they do /me in TEAM_CITIZEN_COLOR.
And how do i set somebody's color back to normal? I have this /adminonduty command it sets the admins color to ADMIN_RED and it says hes on duty but for /adminoffduty how do i make it so it sets the players color back? SCRIPT :
Код:
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
{
if(cmdtext[3] == 0) {
SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
return 1;
}
new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "[ ! ] %s %s", str, cmdtext[4]);
SendClientMessageToAll(COLOR_WHITE, str);
return 1;
}
And how do i set somebody's color back to normal? I have this /adminonduty command it sets the admins color to ADMIN_RED and it says hes on duty but for /adminoffduty how do i make it so it sets the players color back? SCRIPT :
Код:
if(strcmp(cmdtext, "/adminonduty", true) == 0) if(Admin[playerid] == 1)
{
format(tmp,sizeof(tmp),"Admin %s is now on duty.",Name(playerid));
SendClientMessageToAll(COLOR_RED,tmp);
return 1;
}
if(strcmp(cmdtext, "/adminoffduty", true) == 0) if(Admin[playerid] == 1)
{
new COLOR[128];
GetPlayerColor(COLOR,sizeof(COLOR));
format(COLOR,sizeof(COLOR), COLOR);
SetPlayerColor(playerid,COLOR);
format(tmp,sizeof(tmp),"Admin %s is now off duty.",Name(playerid));
SendClientMessageToAll(COLOR_RED,tmp);
return 1;
}


you don't change it , and you don't make anything with color! no sense!