Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:mycolor(playerid, params[])
- {
- enum eCol
- {
- name[12],
- col
- };
- static const _colors[][eCol] = {
- {"red", 0xFF0000AA},
- {"green", 0x00FF00AA},
- {"blue", 0x0000FFAA},
- {"yellow", 0xFFFF00AA}
- };
- for(new i; i < sizeof(_colors); i++)
- {
- if(strfind(params, _colors[i][name], true) != -1)
- {
- SetPlayerColor(playerid, _colors[i][col]);
- return 1;
- }
- }
- // -----
- // Color not found in list, check if hex
- new hex;
- if(sscanf(params, "x", hex))
- return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /mycolor [color name or hexadecimal code]");
- SetPlayerColor(playerid, hex);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement