SA-MP Forums Archive
GodMode Problem in Minigames - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GodMode Problem in Minigames (/showthread.php?tid=611172)



GodMode Problem in Minigames - DandyCorleone - 03.07.2016

Help bro. why in mini game DM got system godmode? then how so that system godmode can disable it automaticy inside mini games DM?


Re: GodMode Problem in Minigames - Theepiccoder - 03.07.2016

Not tested, but should work (if i understood you correctly on what you wanted).
Код:
#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



Re: GodMode Problem in Minigames - DandyCorleone - 03.07.2016

How to Install It?


Re: GodMode Problem in Minigames - Theepiccoder - 03.07.2016

Gimme about 10 mins, ill have it ready.


Re: GodMode Problem in Minigames - DandyCorleone - 03.07.2016

oke oke


Re: GodMode Problem in Minigames - SyS - 03.07.2016

Quote:
Originally Posted by DandyCorleone
Посмотреть сообщение
oke oke
U can visit and join in my server goodluck

server ad
remove this info its against rule no adverting here


Re: GodMode Problem in Minigames - DandyCorleone - 03.07.2016

done, oke ty bro


Re: GodMode Problem in Minigames - Theepiccoder - 03.07.2016

Wait, if you already have a mod, i need to edit it in the mod.


Re: GodMode Problem in Minigames - DandyCorleone - 03.07.2016

oke i can Wait u bro


Re: GodMode Problem in Minigames - Theepiccoder - 03.07.2016

Listen, add me on skype. Ill send you my skype in a private message.