Creating job problem -
DerViL - 10.06.2014
Hi. So i was trying to create one job im sure that i put every code in the right place but when i compile it shows me this
Код:
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\DomVDerevne.pwn(4201) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(4207) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(5317) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(5322) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(5342) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(11782) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(11788) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM(14590) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM(14597) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(14600) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(14610) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(27952) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(27959) : error 032: array index out of bounds (variable "Checkpoint")
C:\Documents and Settings\DrugStyle\Desktop\32_OnLINE_Rp\OnLINE Rp\gamemodes\GM.pwn(27963) : error 032: array index out of bounds (variable "Checkpoint")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
14 Errors.
Re: Creating job problem -
Rufio - 10.06.2014
Can you paste us your Checkpoint variable and some of your usage of "Checkpoint" variables, we are not wizards we must see the issue
Re: Creating job problem -
DerViL - 10.06.2014
pawn Код:
if(Checkpoint[PORTER_JOB][playerid] == 2 && !PlayerToPoint(playerid, 3.0, 246.4563,1410.1707,23.3703))
{
SendClientMessage(playerid, COLOR_WHITE, "You dropped bottle");
DisablePlayerRaceCheckpoint(playerid);
RemovePlayerAttachedObject(playerid, ATT_PACK);
SetPlayerCheckpointEx(playerid, 246.4563,1410.1707,23.3703, CHECKPOINT_PLAYER);
Checkpoint[PORTER_JOB][playerid] = 1;
DeleteAnimation(playerid);
}
pawn Код:
else if(!strcmp(cmd, "/porter", true))
{
if(PlayerInfo[playerid][pJob] != PORTER_JOB) return SendClientMessage(playerid, COLOR_GREEN, "You didnt get the job");
if(!IsPlayerAreaJob(playerid)) return SendClientMessage(playerid, COLOR_GREEN, "You are not in the warehouse");
if(PlayerKarting[playerid] && PlayerInKart[playerid]) return SendClientMessage(playerid, COLOR_GREEN, "While you are in race you cannot work");
if(Checkpoint[PORTER_JOB][playerid] == 0)
{
PlayerAmountPack[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "To take bottle go to the marker");
SendClientMessage(playerid, COLOR_GRAY, "You finished your job write again {FFFFFF}/porter");
Checkpoint[PORTER_JOB][playerid] = 1;
SetPlayerCheckpointEx(playerid, 246.4563,1410.1707,23.3703, CHECKPOINT_PLAYER);
SetPlayerSkin(playerid, 260);
RemovePlayerBandana(playerid, false);
RemovePlayerHat(playerid, false);
}
else
{
if(PlayerAmountPack[playerid] <= 0)
{
SendClientMessage(playerid, COLOR_WHITE, "You didnt earn anything");
}
else
{
new zarplata = PlayerAmountPack[playerid]*25;
GivePlayerMoneyEx(playerid, zarplata);
f(string, "You have have finished your job and you get {9DDAF2}%d$", zarplata);
SendClientMessage(playerid, COLOR_WHITE, string);
}
PlayerAmountPack[playerid] = 0;
Checkpoint[PORTER_JOB][playerid] = 0;
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
DisablePlayerRaceCheckpoint(playerid);
DeleteAnimation(playerid);
RemovePlayerAttachedObject(playerid, ATT_PACK);
if(PlayerInfo[playerid][pBandana] != 0)
{
SetPlayerBandana(playerid, PlayerInfo[playerid][pBandana]);
}
if(PlayerInfo[playerid][pHat] != 0)
{
SetPlayerHat(playerid, PlayerInfo[playerid][pHat]);
}
}
return true;
}
pawn Код:
if(Checkpoint[PORTER_JOB][playerid] == 2 && !PlayerToPoint(playerid, 3.0, 246.4563,1410.1707,23.3703))
{
SendClientMessage(playerid, COLOR_WHITE, "You dropped the bottle");
DisablePlayerRaceCheckpoint(playerid);
RemovePlayerAttachedObject(playerid, ATT_PACK);
SetPlayerCheckpointEx(playerid, 246.4563,1410.1707,23.3703, CHECKPOINT_PLAYER);
Checkpoint[PORTER_JOB][playerid] = 1;
DeleteAnimation(playerid);
return true;
}
pawn Код:
if(Checkpoint[PORTER_JOB][playerid] == 1)
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerCheckpointEx(playerid, 281.0885,1383.2632,10.5859, CHECKPOINT_PLAYER);
ToggleAnimation(playerid, "CARRY", "crry_prtial");
SetPlayerAttachedObject(playerid, ATT_PACK, 918, 1, 0.11, 0.36, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_WHITE, "You took the bottle go to the warehouse");
Checkpoint[PORTER_JOB][playerid] = 2;
return true;
}
if(Checkpoint[PORTER_JOB][playerid] == 2)
{
PlayerAmountPack[playerid] += 1;
SendClientMessage(playerid, COLOR_WHITE, "Go after next bottle");
f(string, "Перенесено бочек: {9DDAF2}%d{FFFFFF} шт.", PlayerAmountPack[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
DisablePlayerRaceCheckpoint(playerid);
DeleteAnimation(playerid);
RemovePlayerAttachedObject(playerid, ATT_PACK);
SetPlayerCheckpointEx(playerid, 246.4563,1410.1707,23.3703, CHECKPOINT_PLAYER);
Checkpoint[PORTER_JOB][playerid] = 1;
return true;
}
pawn Код:
else if(PlayerInfo[playerid][pJob] == PORTER_JOB && Checkpoint[PORTER_JOB][playerid] != 0)
{
PlayerAmountPack[playerid] = 0;
DisablePlayerRaceCheckpoint(playerid);
Checkpoint[PORTER_JOB][playerid] = 0;
DeleteAnimation(playerid);
RemovePlayerAttachedObject(playerid, ATT_PACK);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
if(PlayerInfo[playerid][pBandana] != 0) SetPlayerBandana(playerid, PlayerInfo[playerid][pBandana]);
if(PlayerInfo[playerid][pHat] != 0) SetPlayerHat(playerid, PlayerInfo[playerid][pHat]);
}
Heres all the code for the job
Re: Creating job problem -
Rufio - 10.06.2014
Can you also give the line you defined your Checkpoint variable at ?
Re: Creating job problem -
DerViL - 10.06.2014
You mean this one
If not, then how usually that code looks like?
Re: Creating job problem -
SilentSoul - 10.06.2014
How did you defined the Checkpoint variable? btw you have to do it like this
pawn Код:
new Checkpoint[MAX_PLAYERS]=0;
Usage later:
cmd:job(playerid) CheckPoint[playerid]=1;
if(CheckPoint[playerid] == 1)// however create unique id's for every job.