[Tutorial] How to Make a Derby System With Commands | With ZCMD
#1

Making a Derby System With Commands
Hello,
In This tutorial i will Tell You How to Make a Derby System With Commands ! With zcmd include.
You can get it Here : Zcmd.inc

First of all, lets me tell you what includes i gonna use, Just add these in the top most section of your gamemode or filterscript:

Code:
#include <a_samp>
#include <zcmd>

now you have to add the variables which defines several functions:
These variables are usefull for script functioning. Remember /*x, y, z, facingAnlge*/ By Your Cordinates

Code:
new InDerby[MAX_PLAYERS]; // at the top
new Float:derbyspawns[][] = // at the top
{
    {/*x, y, z, facingAnlge*/},
    {/*x, y, z, facingAnlge*/},
    {/*x, y, z, facingAnlge*/},
    {/*x, y, z, facingAnlge*/},
    {/*x, y, z, facingAnlge*/}
};

Now We Need to Make our Script Colorful, So Some Color we will Define ! Make Sure Place them Under 'new' variables !

Code:
#define COLOR_RED          0xAA3333AA
#define COLOR_GREEN        0x33AA33AA

Now We Move on to Our Commands ! i used zcmd for these Commands Hope You Have Also Downloaded It !
First Command to Enter Derby !

Code:
CMD:derby(playerid,params[])
{
        if(InDerby[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You are already in derby. Type   /leave to exit derby dm");
        new rand = random(sizeof(derbyspawns));
        new veh = CreateVehicle(451,derbyspawns[rand][0],derbyspawns[rand][1],derbyspawns[rand][2],derbyspawns[rand][3],-1,-1,-1);
        PutPlayerInVehicle(playerid,veh,0);
        InDerby[playerid] = 1;
        return 1;
}

Now Our second Command, thats To leave the Derby !

Code:
CMD:leave(playerid,params[])
{
        if(InDerby[playerid] == 0) return SendClientMessage(playerid,COLOR_GREEN,"You are not in derby!");
        InDerby[playerid] = 0;
        SetPlayerHealth(playerid,0);
        return 1;
}

Now at the End, add this :

Code:
#endif

You Are Now Done with the Derby Script !
the Full Script is : Pastebin
Credits:
*Avi for Writing the Whole Tutorial.
*Zeex For his zcmd


Enjoy !
Add me some reputation (REP+) if i helped you.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)