Toggle OOC chat
#1

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;
}
Reply
#2

Show us the error line.
Reply
#3

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.
Reply
#4

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

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

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.
Reply
#7

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

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

Maybe can you help me?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)