SA-MP Forums Archive
Toggle OOC chat - 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: Toggle OOC chat (/showthread.php?tid=275672)



Toggle OOC chat - vent - 10.08.2011

Hello! I need some help with an tog ooc chat script. It will give shitloads of errors about ToggleOOC. Anyways here is the code:
Код:
	if(!strcmp(cmdtext, "/o", true,2)){
    if(ToggleOOC == 0)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "OOC chat on suletud!");
        return 1;
    }
    if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "[Kasutus:] /o [tekst]");
    else {
        new tmp[192];
        GetPlayerName(playerid,tmp,24);
        format(tmp,192,"[OOC] %s: %s",tmp,cmdtext[5]);
        SendClientMessageToAll(0xFFFFFFAA,tmp);
        print(tmp);
    }
    return 1;
 }

 if(!strcmp(cmdtext, "/togooc", true,10))
{
    if(!IsPlayerAdmin(playerid))//or whatever your admin variable is
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "You are not an admin");
        return 1;
    }
    if(ToggleOOC == 1)
    {
        ToggleOOC = 0;
        SendClientMessageToAll(0xFFFFFFFF, "Global OOC chat has been disabled");
    }
    else
    {
        ToggleOOC = 1;
        SendClientMessageToAll(0xFFFFFFFF, "Global OOC chat has been enabled");
    }
    return 1;
}



Re: Toggle OOC chat - =WoR=Varth - 10.08.2011

Show us the error line.


Re: Toggle OOC chat - vent - 10.08.2011

Here you go

Код:
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(542) : error 017: undefined symbol "ToggleOOC"
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(558) : warning 217: loose indentation
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(565) : error 017: undefined symbol "ToggleOOC"
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(567) : error 017: undefined symbol "ToggleOOC"
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(567) : warning 215: expression has no effect
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(572) : error 017: undefined symbol "ToggleOOC"
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(572) : warning 215: expression has no effect
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(577) : warning 209: function "zcmd_OnPlayerCommandText" should return a value
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(578) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Toggle OOC chat - =WoR=Varth - 10.08.2011

pawn Код:
new ToggleOOC;//On top of your script
Are you using, zcmd?


Re: Toggle OOC chat - [MG]Dimi - 10.08.2011

I think he just copied this from another script. Right?


Re: Toggle OOC chat - vent - 10.08.2011

Half of the script uses zcmd. And with your code it still says Unknown command.

Код:
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(577) : warning 209: function "zcmd_OnPlayerCommandText" should return a value
C:\Users\Tuumajaam\Desktop\Rдndom shit (vb porn)\samp\korralik server mille ьritan lхpuni teha\filterscripts\ace2.pwn(578) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           1980 bytes
Code size:            34000 bytes
Data size:            15100 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4238 cells (16952 bytes)
Total requirements:   67464 bytes

2 Warnings.



Re: Toggle OOC chat - vent - 10.08.2011

No i didnt copy from it another GM. I got that from that forum. ;>


Re: Toggle OOC chat - =WoR=Varth - 10.08.2011

You can't use zcmd and OnPlayerCommandText in the same script. Convert all of them to zcmd.


Re: Toggle OOC chat - vent - 10.08.2011

Maybe can you help me?


Re: Toggle OOC chat - =WoR=Varth - 10.08.2011

https://sampforum.blast.hk/showthread.php?tid=271043