GodMode Problem in Minigames
#1

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

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
Reply
#3

How to Install It?
Reply
#4

Gimme about 10 mins, ill have it ready.
Reply
#5

oke oke
Reply
#6

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
Reply
#7

done, oke ty bro
Reply
#8

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

oke i can Wait u bro
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)