22.02.2009, 12:31
Quote:
|
Originally Posted by Mikep
Use a variable, e.g:
new waron[MAX_PLAYERS]; To turn it off: waron[playerid] = 0; Replace 0 with 1 to enable it again. Use if(waron[playerid] == 0) return whatever in your command to disable it. |
Just a lil more info

At top of script
pawn Код:
new WarStatus = 0|1; // 0 for disabled and 1 for enabled when the server starts will be changed later
pawn Код:
if(strcmp("/toggle-war", cmdtext, true) == 0 ) {
if ( WarStatus == 0 ) {
WarStatus = 1;
} else {
WarStatus = 0;
}
return 1;
}
/ /And
if ( WarStatus == 1 ) {
if(strcmp("/warww", cmdtext, true) == 0 ) {
if (GetPlayerMoney(playerid) < 5000)
{
GameTextForPlayer(playerid,"You Got No Money",1000,0);
}
else
{
SendClientMessage(playerid, 0x33AA33AA, "Welcome To Server At War");
SetPlayerPos(playerid, -2160.8521, 158.0676, 62.1094);
GivePlayerMoney(playerid, -1000);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 24, 9999);
GivePlayerWeapon(playerid, 27, 9999);
SetPlayerArmour(playerid, 100);
return 1;
}
} else {
SendClientMessage(playerid, color, "War is deactivated !");
}

