16.12.2009, 10:44
Код:
new DmEnabled = 1; //insert in OnPlayerCommandText new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/dm", true) == 0) { if(DmEnabled) { //dm code } else { SendClientMessage(playerid, COLOR_WHITE, "DM is disabled by an admin."); } } if(strcmp(cmd, "/togdm", true) == 0) { if(IsPlayerAdmin(playerid)) { if(DmEnabled) { DmEnabled = 0; SendClientMessageToAll(COLOR_WHITE, "DM is disabled now."); } else { DmEnabled = 1; SendClientMessageToAll(COLOR_WHITE, "DM is enabled now."); } } }
PS. I added those "new cmd[256]" and etc. because it might not work for you without those. It's like i have in my script.