This isn't working. - 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: This isn't working. (
/showthread.php?tid=106509)
This isn't working. -
Packer5 - 03.11.2009
I used this code from GF:
Код:
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
{
new string[256];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREEN, "USAGE: (/o)oc [ooc chat]");
return 1;
}
format(string, sizeof(string), "(( %s: %s ))", sendername, result);
// OOCOff(COLOR_OOC,string);
printf("%s", string);
return 1;
}
I had to change some stuff, but it isn't working... If I type: /ooc, it tells me the propper usage, but it doesnt work as OOC. maybe someone can help? thanks
Re: This isn't working. -
MadeMan - 03.11.2009
You have OOCOff disabled. Remove the // from that line.
Re: This isn't working. -
introzen - 03.11.2009
You made a string, but you don't send it to the server:
pawn Код:
format(string, sizeof(string), "(( %s: %s ))", sendername, result);
// OOCOff(COLOR_OOC,string);
just remove the comment line:
pawn Код:
format(string, sizeof(string), "(( %s: %s ))", sendername, result);
OOCOff(COLOR_OOC,string);