02.04.2009, 05:46
Hello im beginner pawno scripter. I need help with /ooc command.
Currently my command works like this:
/ooc hi
[OOC] Lastman: Hi white coloured
I want it to be like this:
[OOC] Lastman [ID]: Hi
I want [OOC] to be in white colour. Player nick to be in GetPlayerColor. Player id in white and the text to be in white.
My code is given below. Please assist me.
- Lastman
Currently my command works like this:
/ooc hi
[OOC] Lastman: Hi white coloured
I want it to be like this:
[OOC] Lastman [ID]: Hi
I want [OOC] to be in white colour. Player nick to be in GetPlayerColor. Player id in white and the text to be in white.
My code is given below. Please assist me.
- Lastman
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) { if(IsPlayerConnected(playerid)) { if(Muted[playerid]) { SendClientMessage(playerid, COLOR_LIGHTGREEN, "[ERROR:] You can't speak, your muted!"); return 1; } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_LIGHTGREEN, "Correct Usage: [/o]oc [message]"); return 1; } if(PlayerInfo[playerid][pAdmin] >= 1 && AdminDuty[playerid] == 1) { format(string, sizeof(string), "[OOC] Admin %s: %s ", GetPlayerNameEx(playerid), result); SendClientMessageToAll(COLOR_CIVILIAN,string); OOCLog(string); return 1; } else if(PlayerInfo[playerid][pDonator] == 1) { format(string, sizeof(string), "[OOC] Donator %s: %s ", GetPlayerNameEx(playerid), result); SendClientMessageToAll(COLOR_CIVILIAN,string); OOCLog(string); } else { format(string, sizeof(string), "[OOC] %s: %s ", GetPlayerNameEx(playerid), result); SendClientMessageToAll(COLOR_CIVILIAN,string); OOCLog(string); } } return 1; }