03.07.2016, 04:34
Help bro. why in mini game DM got system godmode? then how so that system godmode can disable it automaticy inside mini games DM?
#include <a_samp> #include <zcmd> // DEFINING IT ALL new GodMode[MAX_PLAYERS]; new InDM[MAX_PLAYERS]; new PreviousGodMode[MAX_PLAYERS]; // DEFINING IT ALL // COMMAND FOR GODMODE CMD:godmode(playerid, params[]) { if(InDM[playerid] == 1) { SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}ERROR: {FFFFFF}You are in a deathmatch arena!"); } else { GodMode[playerid] = 1; PreviousGodMode[playerid] = 1; SetPlayerHealth(playerid, 999999.99); } return 1; } // COMMAND FOR GODMODE // COMMAND FOR ENTERING DEATHMATCH CMD:enterdm(playerid, params[]) { SetPlayerPos(playerid, <cords here>); GodMode[playerid] = 0; InDM[playerid] = 1; SetPlayerHealth(playerid, 100); return 1; } // COMMAND FOR ENTERING DEATHMATCH // COMMAND FOR EXITING DEATHMATCH CMD:exitdm(playerid, params[]) { SetPlayerPos(playerid, <cords here>); InDM[playerid] = 0; if(PreviousGodMode[playerid] == 0) { return 1; } else if(PreviousGodMode[playerid] == 1) { GodMode[playerid] = 1; SetPlayerHealth(playerid, 999999.99); } return 1; } // COMMAND FOR EXITING DEATHMATCH // WHEN PLAYER SPAWNS, IT CHECKS IF GODMODE IS ENABLED FOR PLAYER public OnPlayerSpawn(playerid) { if(GodMode[playerid] == 1) { SetPlayerHealth(playerid, 999999.99); } else { SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}ERROR: {FFFFFF}You aren't in godmode."); } return 1; } // WHEN PLAYER SPAWNS, IT CHECKS IF GODMODE IS ENABLED FOR PLAYER // WHEN PLAYER CONNECTS, GODMODE GETS DISABLED FOR PLAYER public OnPlayerConnect(playerid) { GodMode[playerid] = 0; InDM[playerid] = 0; PreviousGodMode[playerid] = 0; return 1; } // WHEN PLAYER CONNECTS, GODMODE GETS DISABLED FOR PLAYER // WHEN PLAYER DISCONNECTS, GODMODE GETS DISABLED FOR PLAYER public OnPlayerDisconnect(playerid) { GodMode[playerid] = 0; InDM[playerid] = 0; PreviousGodMode[playerid] = 0; return 1; } // WHEN PLAYER DISCONNECTS, GODMODE GETS DISABLED FOR PLAYER