10.08.2011, 16:53
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; }