[Tutorial] How to make a God Mode command.
#1

How to create a GodMode Command using ZCMD

Hello, In this tutorial, we'll be learning how to create a /godmode command using ZCMD.

We will need ZCMD.ini which could be found here: https://sampforum.blast.hk/showthread.php?tid=91354

Step 1: Including ZCMD

All you have to do here is:
pawn Код:
#include <zcmd>
Step 2: Defining

This is just a simple step, we're going to define Godmode to have control of how its going to work and when
pawn Код:
new GodMode[MAX_PLAYER_NAME];
In my opinion, its better to keep it after ' #endif '

Step 3: Adding the command
Since we have ZCMD now we just simply type CMD: to create a command so
pawn Код:
CMD:godmode(playerid, params[])
{
    SetPlayerHealth(playerid, Float:0x7F800000 );
    GodeMode[playerid] = 1;
}
Modifying your script

Since we only have /gm to turn your godmode, and you dont want it on or you dont know wether it works or not, then lets add something to turn it off and send a message to you!

pawn Код:
CMD:godmode(playerid, params[])
{
    if(GodMode[playerid] == 0)          //If godMode is not on
    {                                            //then
        SetPlayerHealth(playerid, Float:0x7F800000 );   //Float:0x7F800000 Means infinite health.
        SendClientMessage(0x24FF0AB9,playerid,"God Mode has been turned on! Type /godmode again if you want to turn it off!");
        GodeMode[playerid] = 1;         //Turn godmode on
    }
    else if(GodMode[playerid] == 1)   // Else if its on
    {                                           //then
        SetPlayerHealth(playerid, 100);
        SendClientMessage(0xFF0000AA ,playerid,"God Mode has been turned off! Type /godmode again if you want to turn it on!");
        GodMode[playerid] = 0;           //Turn godmode off
    }
}
__________________________________________________ _______________________________________________

THIS WAS SCRIPTED IN THIS BROWSER ITSELF AND HAS NOT BEEN TESTED, LET ME KNOW IF THERE ARE ANY BUGGS, Thank you

Since this is my First Tutorial, I'd like feedbacks from you guys, and I hope you have understood how this has been created.

Reply


Messages In This Thread
How to make a God Mode command. - by Zarky - 08.02.2014, 12:55
Re: How to make a God Mode command. - by daniscape - 08.02.2014, 13:14
Re: How to make a God Mode command. - by Zinedine - 08.02.2014, 13:59
Re: How to make a God Mode command. - by Unfriendly - 09.02.2014, 15:13
Re: How to make a God Mode command. - by Golimad - 12.02.2014, 19:16
Re: How to make a God Mode command. - by Zarky - 04.04.2014, 07:31
Re: How to make a God Mode command. - by JevieraJehan - 17.04.2014, 06:53
Re: How to make a God Mode command. - by Zarky - 01.09.2014, 02:26
Re: How to make a God Mode command. - by Abagail - 01.09.2014, 13:54
Re: How to make a God Mode command. - by GGRoleplay - 01.09.2014, 16:35

Forum Jump:


Users browsing this thread: 1 Guest(s)