if (strcmp("/leave", cmdtext, true, 10) == 0) { if(m4w[playerid] == 1) { SpawnPlayer(playerid); ResetPlayerWeapons(playerid); SetPlayerInterior(playerid, 1); sw[playerid] = 0; m4w[playerid] = 0; SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156); return 1; } else if(sw[playerid] == 1) { SpawnPlayer(playerid); ResetPlayerWeapons(playerid); SetPlayerInterior(playerid, 1); sw[playerid] = 0; m4w[playerid] = 0; SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156); return 1; } else { SendClientMessage(playerid, COLOR_NORMALRED, "You can only use this command while in war"); return 1; } }
if(m4w[playerid] == 1 || sw[playerid] == 1) return SendClientMessage(playerid, COLOR_NORMALRED, "You cannot use this command while in war."); //I'm assuming this is the message you want.
new IsInDM[MAX_PLAYERS] = 0; //Creating variable...
if (strcmp("/deathmatch", cmdtext, true, 10) == 0)
{
IsInDM[playerid] = 1;//Sets the variable to 1 so he cannot leave
}
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
if(IsInDM[playerid] == 1) return SendClientMessage(playerid, COLOR, "Uhm..you're in deathmatch");
SetPlayerHealth(playerid, 100);//Sets the players health to 100 if he is NOT in a DM zone
}
Roomeo can you read? that's not his question.
Anyway you can use something like this: pawn Код:
|
public OnPlayerComandText(...)
{
if(m4w[playerid] == 1 || sw[playerid] == 1) return SendClientMessage(playerid,color,"You're in m4w and sw and you cant use commands!");
}
It's possible, if you want 1 command avaible..
pawn Код:
|
It's possible, if you want 1 command avaible..
pawn Код:
|
if(m4w[playerid] == 1 || sw[playerid] == 1) { SendClientMessage(playerid,COLOR_NORMALRED,"You are in war and can not use any commands"); return 1; } else if (strcmp("/leave", cmdtext, true, 10) == 0) { if(m4w[playerid] == 1) { SpawnPlayer(playerid); ResetPlayerWeapons(playerid); SetPlayerInterior(playerid, 1); sw[playerid] = 0; m4w[playerid] = 0; SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156); return 1; } else if(sw[playerid] == 1) { SpawnPlayer(playerid); ResetPlayerWeapons(playerid); SetPlayerInterior(playerid, 1); sw[playerid] = 0; m4w[playerid] = 0; SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156); return 1; } else { SendClientMessage(playerid, COLOR_NORMALRED, "You can only use this command while in war"); return 1; } }