08.02.2014, 12:55
(
Последний раз редактировалось Zarky; 01.09.2014 в 02:35.
)
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:
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
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
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!
__________________________________________________ _______________________________________________
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.
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>
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];
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;
}
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.