[Tutorial] How to make a Robbery System V1.0 --NEW--
#1

Hello every one I'am AMCNR and i will gonna show you an Tutorial.
In This Tut. I will show you how to make a Robbery system.

Let's begin

Lesson 1:
Код:
#include <a_samp>
#include <zcmd>
Include a_samp
and ZCMD

Lesson 2:
Код:
#define COLOR_LOCALMSG 0xEC5413AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_AQUA 0x00FFFFAA
#define COLOR_ADMINCMD 0xF97804FF
#define COLOR_ADMINDUTY 0x007E96F6
#define COLOR_NOTLOGGED 0x00000000
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define	COLOR_MONEYBAR 0x005800FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_DARKRED 0xCD000000
#define COLOR_ANTICHEAT 0xAA3333AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTBLUE2 0x0080FFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_LIGHTORANGE 0xFF8000FF
#define COLOR_DARKBROWN 0xB36C42FF
#define COLOR_MEDIUMBLUE 0x1ED5C7FF
#define COLOR_LIGHTYELLOW 0xE0E377AA
#define COLOR_LIGHTYELLOW2 0xE0EA64AA
#define COLOR_LIGHTYELLOW3 0xFF6347AA
#define COLOR_DARKPURPLE 0x5F56F8AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
#define COLOR_ALLDEPT 0xFF8282AA
#define COLOR_NEWS 0xFFA500AA
#define COLOR_OOC 0xE0FFFFAA
#define COLOR_NEWOOC 0x0080FFAA
#define COLOR_RED 0xFF0000FF
Define some colors.
PS: I got much not needed!

Lesson 3:
Код:
//Now you can add on Your OnGameModeInIt 3dTextlabels Else Checkpoints or Pickups What u want.
//here I'dont gonna show.
Lesson 4:
Код:
new Robbank[MAX_PLAYERS];
new Robammu[MAX_PLAYERS];
new Robcityhall[MAX_PLAYERS];
new Robgasstation[MAX_PLAYERS];
new Robpizza[MAX_PLAYERS];
new Robgym[MAX_PLAYERS];
new Robatm[MAX_PLAYERS];
Add Some Timers and Robbery System Things.
PS: I'dont really give the timers a name.

Lesson 5:
Код:
CMD:robbank(playerid, params[]) //Command robbank
{
    if (Robbank[playerid] == 0 ) //Getting If Your not recently robbed the bank
 	if(IsPlayerInRangeOfPoint(playerid,2.0,2309.6543,-8.5004,26.7422)) //Gets your Pos.
    {
    SendClientMessage(playerid, COLOR_GREEN, "You robbing the bank 30 seconds left!"); //Sending a ClientMessage 30 sec left
	Robbank[playerid] = 1; // Give's your Recently Robbed
	SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+3); //Sets your wanted level to 3
    SetTimerEx("RobBank", 30000, false, "i", playerid); //Timer 1 Ticks when your robbing 30 seconds
    SetTimerEx("after1", 50000, false, "i", playerid);
    } else {
	SendClientMessage(playerid, COLOR_RED, "[ERROR:]You are no in rob checkpoint!"); // Sends a SCM Your not on a Checkpoint.
    }
    return 1;
}
Let's begin coding some commands.

Lesson 6:
Код:
forward RobBank(playerid); //Forwards your public
public RobBank(playerid)
{
	new rand = random(130000)+0; //When your robbing you get 0-130000 cash random
	GivePlayerMoney(playerid,rand); //it Gives your the random cash
    SendClientMessage(playerid, COLOR_GREEN, "You Rob the bank and now have 3 wanted level!"); //Gives you 3 wanted stars
    TogglePlayerControllable(playerid,1); //You can walk again
    return 1;
}
Important stuff

Thanks for reading i hope it helped you.
I Only made a robbery system for bank but you can copy the things change the names the Timers etc.

PS: IF YOU THINK I STOLE THIS IT IS'NT TRUE!

+ rep can not hurt.

Greatz
-AMCNR
Reply
#2

This is a bad method.. try to use one timer for all the robbery places.
Reply
#3

Код:
This is a bad method.. try to use one timer for all the robbery places.
I'know but... i used this way you can do it like this.

In every Command you can change this
Код:
timer1 = SetTimerEx("RobBank", 30000, false, "i", playerid); //< not the timer but "Robbank" The Timer etc.
U mean this?
Reply
#4

No I mean like

pawn Код:
SetTimerEx("global_robbery", 30000, false, "i", playerid);
Then handle every single robbery there
Reply
#5

For me is Timer very usefull with this you can do it on your method and mine.
Reply
#6

What? your method can create major lag, not to mention using a timer for each robbery.. isn't needed. With my method, you're just using one timer (less lag).

Also, fix the indentation.
Reply
#7

Shame on you...
Reply
#8

Sorry but this isn't even a tutorial.... This is instructions...

You are just saying, put dis here, then put this here.. lets add some random stuff like dat... yeee

This tutorial is not worth anything to look at. Sorry.
Reply
#9

Edited
Reply
#10

Explains your -10 rep :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)