[Tutorial] How to setup your Gamemode
#1

Setting up your gamemode

- Okay, i'm sick and tired off all those "where to put", "where i i insert this" Replys when i try to help people out, I will later on in this tuturial show some of the replys.

Some of you are alot experienced then others.
Haterz Gtfo, if you don't find this useful go troll some elsewhere.

First of all, My own Cutsomized "New.pwn"

Код:
/*

*///================= [ Includes ] ===========================================//

//================= [ Defines ] ==============================================//

//================= [ Forwards ] =============================================//

//================= [ Enums ] ================================================//

//================= [ Symbols ] ==============================================//

//================= [ Callbakcs ] ============================================//

//================= [ Functions ] ============================================//

//================= [ Stocks ] ===============================================//

//================= [ Commands] ==============================================//
That's it, that's all i ever start of when i'm scripting. I will explain each single part And show example code.

This is the first part, this is were i put the credits & includes.
pawn Код:
/*
             Some Fucking Good GM BY MASTASCRTPAHH1337z00r
                        v.0.0.0.0.0.0.0.1 rc 1
*/
//================= [ Includes ] ===========================================//

// This is were i put my includes, pretty obvious.
#include <a_samp>
The second part is were i put my defines.
pawn Код:
//================= [ Defines ] ==============================================//

#define MAX_NOOBS (MAX_PLAYERS)
#define MAX_NOOB_CAKES 10 // How many cakes noobs can have.
The next part is were i put my forwards.

pawn Код:
//================= [ Forwards ] =============================================//
forward GivePlayerNoobCake(playerid);
The next part is regarding enumerators
pawn Код:
//================= [ Enums ] ================================================//
enum NoobInfo
{
     NoobCakes,
}
The next part includes symbols.
pawn Код:
//================= [ Symbols ] ==============================================//
new NoobInfo[MAX_NOOBS][NoobInfo];
The next part is were i put my Callbacks, this is were the Shit happens !

pawn Код:
//================= [ Callbakcs ] ============================================//

public OnPlayerConnect(playerid)
{
     return GivePlayerNoobCake(playerid);
}
Next part is were i put my Functions ( custom public's, needs forwarding. )

pawn Код:
//================= [ Functions ] ============================================//
public GivePlayerNoobCake(playerid)
{
     NoobInfo[playerid][NoobCakes]++;
}
Next part shows were i put my stocks.

pawn Код:
//================= [ Stocks ] ===============================================//
stock GetPlayerNoobCakes(playerid)
{
     return NoobInfo[playerid][NoobCakes];
}
Last but not least, commands.

pawn Код:
//================= [ Commands] ==============================================//
command(givecake, playerid, params[])
{
     return GivePlayerNoobCake(playerid);
}
That's it, there's no real recipe on how to setup your gm, but this way i keep my gm smooth and clean also makes it easier to manage through.

Hall of fame
  1. Quote:
    Originally Posted by IvancheBG
    Посмотреть сообщение
    Ok but where to put all these stuff
  2. Quote:
    Originally Posted by DeLexia
    Посмотреть сообщение
    How and where to put it?
- If you find any comments similar to the one above, please post it and ill put it onto the Hall of fame.
Reply


Messages In This Thread
How to setup your Gamemode - by Cameltoe - 14.04.2011, 17:03
Re: How to setup your Gamemode - by BASITJALIL - 14.04.2011, 17:07
Re: How to setup your Gamemode - by Cameltoe - 14.04.2011, 17:09
Re: How to setup your Gamemode - by Stigg - 14.04.2011, 17:09
Re: How to setup your Gamemode - by Miller - 14.04.2011, 17:09
Re: How to setup your Gamemode - by BASITJALIL - 14.04.2011, 17:10
Re: How to setup your Gamemode - by Cameltoe - 14.04.2011, 17:11

Forum Jump:


Users browsing this thread: 1 Guest(s)