Help with GodMode commands :D
#1

Hi everyone, I've tried to eliminate the weapons when the player uses GodMode command, I mean .. I want the player did not use a weapon while being GodMode, I've tried but failed .. maybe you guys can help, please

Thank you for helping me
Reply
#2

I mean when a player uses GodMode command, the player can not use weapons command
Reply
#3

Top of the gamemode:
Код:
new IsGodmode[MAX_PLAYERS];
I'll just make a quick example of how you have to do with your "guns command"
Код:
CMD:guns(playerid,params[])
{
if (IsGodmode[playerid] == 1) { //checks that the guy that is doing the command is godmode or not
SendClientMessage(playerid,COLOR_RED,"You can't use that command while in Godmode!"); //sends a message on chat
} else { //if he isn't godmode do the following
GivePlayerWeapon(playerid,31,300); //It gives the weapon
}
return 1;
}
Reply
#4

Just a little fix for the above command,
because it may cause some kind of bug depending on your code

On top of script:
Код:
new godmodestatus[MAX_PLAYERS];
In OnPlayerConnect write this:
Код:
godmodestatus = 0;
Under your godmode command write this:
PHP код:
// if enabled -- depends on your command :/ idk what it will be
godmodestatus 1;
// if disabled -- depends on your command :/ idk what it will be too
godmodestatus 0
and finally under your weapons cmd:
PHP код:
CMD:weapons(playerid,params[])
{
   if (
godmodestatus[playerid] == 1) return SendClientMessage(playerid, -1"You can't get weapons if godmode is on!");
   
// code

Hope it helps.
Reply
#5

Thank you all for helping me, +Rep
Reply
#6

Nice gj
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)