[Tutorial] Detailed Guide: Creating jobs (easy)
#1

Introduction
Hello guys, today i will be teaching you with details explaining how to make jobs

So lets get started! Lets start by defining are jobs. If you are gonna make a serious job system you must use jobless and your job. Now on to the coding. We're gonna start by
Code:
#define Jobs 2
First job is Jobless for serious job system. Second one is your job you want. But wait we need our variable for the job so lets put below
Code:
Include <a_samp>
Code:
new cJob[MAX_PLAYERS];
Okay so whats that gonna do is make our job. You can change cJob to anything you want
MAX_PLAYERS is gonna let this job be for the max players for ex: if you have samp players of 20 out of 100 and 10 join it will let them join because we have MAX_PLAYERS Okay so now lets put our "defined jobs' First job:
Code:
#define JOBLESS 0
you want to put that under #define Jobs 2 now for the second job :
Code:
#define [yourjobname] 1// this will define your job we're using. more will be explained
Okay so now lets move on to the job coding. so you're wondering how do you make the job so you can be set to it. Well to do that lets start by
Code:
 cJob[playerid] > 1 // we defined that using #define [yourjobname] 1
So what that does is sets your job you can use it on anything really for ex:
Code:
public OnPlayerEnterVehicle
{
     GetPlayerVehicleId(playerid);
     if(vehicle > 431)
     SendClientMessage(playerid,-1,"You have entered a bus you will now begin bus duty");
     cJob[playerid] > 1 // the job has been set to him as a bus driver"
     return 1;
}
What that does is when the player enters te vehicle it will get his vehicle id and if its 431 it will send him a message "you have entered a bus you will now begin bus duty"
then the job will be set to him im going to show you some commands now using cJob[playerid] > 1
and note thats just a simple job you can remove
Code:
  #define Jobs 2 and set it to #define Jobs 1 and remove #define JOBLESS thats only if you dont want a jobless job
Okay so anyways on to the commands
We're gonna use zcmd so lets start to put
Code:
#include <zcmd>
right under
Code:
#include <a_samp>
note: i will put zcmd in download Okay so lets remove
Code:
public OnPlayerCommandText
including the brackets remove those too.Okay so replace that with
Code:
CMD:join(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, x, y,z,)) // put your posx posy and posz
     cJob[playerid] > 1
     SendClientMessage(playerid,0xeAFAFFA,"congratulation you are now [yourjobname] /help to see your new job and commands");
return 1;
}

CMD:myjobcommand(playerid, params[])
{
     if(cJob[playerid] > 0
     return SendClientMessage(playerid,-1,"your jobless!");
     SendClientMessage(playerid,-1,"your [yourjobname]");
     return 1;
}
Okay so thats all.

Tips: getting better and better with scripting / making jobs:
Make a job help command showing for a certain job only
Make a job command for a certain job only

credits: zcmd
credits: cluckinucker

zcmd:http://www.solidfiles.com/d/d20f/
Reply
#2

woow this is a crap....
Where is the saving?
This tut is sucks.
Reply
#3

pawn Code:
GetPlayerVehicleId(playerid);
     if(vehicle > 431)
Means.. every vehicle above ID 431, this won't work.

pawn Code:
if(GetVehicleModel(vehicleid) == 431)
- I suggest you to rewrite this code, It won't work.
Reply
#4

This is not a good tutorial bro.Try to make a bit better cause there are many mistakes and problems.
Reply
#5

how about the checkpoints and stuff like that? or random job selections?
Reply
#6

This is not a tutorial.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)