[HELP] Job Script
#1

Well, here is my code.

Код:
public JobArmsDealer()
{
 	for(new i=0; i<MAX_PLAYERS; i++ )
  {
    if(IsPlayerConnected(i))
    {
      if(PlayerToPoint(1, i, 1366.4478,-1274.9559,13.5469)) // Location that the player has to be at to get the job.
      {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(i, x, y, z);
        if (GetPlayerTeam(i) == 1);
        {
				SendClientMessage(i, COLOR_WHITE, "LSPD cannot get Arms Dealer!");
				}
				if (GetPlayerTeam(i) == 2);
				{
				SendClientMessage(i, COLOR_WHITE, "FBI cannot get Arms Dealer!");
				}
				if (GetPlayerTeam(i) == 3);
				{
				SendClientMessage(i, COLOR_WHITE, "You already have a job!");
				}
				if (GetPlayerTeam(i) == 4);
				{
				SendClientMessage(i, COLOR_WHITE, "You already have a job!");
				}
				if (GetPlayerTeam(i) == 5);
				{
				SendClientMessage(i, COLOR_WHITE, "You already have a job!");
				}
				if (GetPlayerTeam(i) == 6);
				{
				SendClientMessage(i, COLOR_WHITE, "You are already a Arms Dealer!");
				}
				if (GetPlayerTeam(i) == 7);
				{
				SendClientMessage(i, COLOR_WHITE, "You already have a job!");
				}
				else
				{
				SetPlayerTeam(i, 6);
				}
			}
		}
	}
	return 0;
}
Here are my errors:

Код:
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(748) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(752) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(756) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(760) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(764) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(768) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(772) : error 036: empty statement
C:\Users\Administrator\Desktop\SAMP Server\gamemodes\cgroleplay.pwn(776) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
This is my first go at a self-written job script. Anyone have a clue?

Thank you.
Reply
#2

Is

Код:
(GetPlayerTeam(i) == 2);
wrong?

Thats the lines the errors are showing up on, is every line with GetPlayerTeam in it.
Reply
#3


Код:
(GetPlayerTeam(i) == 2)//remove ; on all
Reply
#4

Awesome. It worked. Thank you.

One more thing...

How would I go about making it to where you have to type a command while standing on the icon to get the job?

Sorry, this is my first time writing one.
Reply
#5

Look up PlayerToPoint.
Reply
#6

That is to check if the player is within range of the point I have set. I was wondering if I could make it to where the player has to type /getjob to get the job, and then /acceptjob to finalize it before they can get the job. Right now, if they were to walk over the point, they would get the job.
Reply
#7

Exactly, set the radius to 1.0 so it is exactly in the same coordinates as the icon..
Reply
#8

How does that have anything to do with setting the commands up?
Reply
#9

Quote:
Originally Posted by Haegon
How would I go about making it to where you have to type a command while standing on the icon to get the job?
You asked how you would set 'it' up.
Basically use a command like this:

pawn Код:
if(strcmp(cmdtext, "/join", true) == 0)
{
    if(PlayerToPoint(1.0, playerid, hitcordx, hitcordy, hitcordz))
    {
        GameTextForPlayer(playerid, "You picked the Hitman Job! ~n~Type /acceptjob to accept.", 2500, 3); // hitman job
    }
    else if(PlayerToPoint(1.0, playerid, bincordx, bincordy, bincordz))
    {
        GameTextForPlayer(playerid, "You picked the Binman Job! ~n~Type /acceptjob to accept.", 2500, 3); // binman job.
    }
    return 1;
}
That is how the command would work, with a radius of 1. The only thing other than that is the /acceptjob command. Where you would check where he is so he recives the right job.

For the 'hitcord' and 'bincord' that is where the icon is placed for the matching job.
Reply
#10

Awesome. Thank you, Lj!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)