19.12.2011, 14:27
pawn Код:
if(strcmp(cmd, "/write", true) == 0 && PlayerAdminLevel[playerid] >= 1){
if(IsAdminOrRecon[playerid] == 0){
SendClientMessage(playerid,COLOR_ERROR,"Please Login Into Your Mod/Admin Account! Use /adminlog");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /write [Colour] [Text]");
SendClientMessage(playerid, COLOR_WHITE, "Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink");
return 1;
}
new Colour;
Colour = strval(tmp);
if(Colour > 9 || Colour < 0) {
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /write [Colour] [Text]");
SendClientMessage(playerid, COLOR_WHITE, "Colours: 0=black 1=white 2=red 3=orange 4=yellow 5=green 6=blue 7=purple 8=brown 9=pink");
return 1;
}
tmp = strtok(cmdtext, idx);
if(Colour == 0) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_BLACK,string);
return 1;
}
else if(Colour == 1) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_WHITE,string);
return 1;
}
else if(Colour == 2) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_RED,string);
return 1;
}
else if(Colour == 3) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_ORANGE,string);
return 1;
}
else if(Colour == 4) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
else if(Colour == 5) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_GREEN,string);
return 1;
}
else if(Colour == 6) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_BLUE,string);
return 1;
}
else if(Colour == 7) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_PURPLE,string);
return 1;
}
else if(Colour == 8) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_BROWN,string);
return 1;
}
else if(Colour == 9) {
format(string,256,"%s",cmdtext[9]); SendClientMessageToAll(COLOR_PINK,string);
return 1;
}
return 1;
}
how i can make in that command like in 1 sentence i can write more than 1 color like /ann command when i use ~r~ or ~w~ or ~g~