[Help] Cmd: /ooc - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Cmd: /ooc (
/showthread.php?tid=71550)
[Help] Cmd: /ooc -
Lastman - 02.04.2009
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
Код:
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;
}
Re: [Help] Cmd: /ooc -
Kinetic - 02.04.2009
Tell us what is happening that is wrong first.
Re: [Help] Cmd: /ooc -
Lastman - 02.04.2009
Nothing is wrong kinetic. I just want to modify the ooc chat according to me.
Currently ooc works as this:
when i type: /ooc Hello
it says: [OOC] Lastman: Hello
Which is fully in white coloured. color_civilian
But i want it to show like this:
when i type /ooc Hello
It should say:
[OOC] Lastman [ID]: Hello
Which is i want our nickname to show in our player color. The color which it shows when we press TAB. Our player nickname color that is what i mean. so i want [OOC] to be in white. Player Nick to be in Player Nick Color. And Text to be in White. as shown in my example ( i have shown green color instead of white in my example as white doesnt display on background)