Creating robbery's
#1

Hi guys im having a little problem here... i created 1 more robbery on a CnR script just to see how to create it and when i go into the checkpoint i dont even see it and it is a little bit for the side where i putted it. And when i go into that place it keeps spamming me to do /robstore D: i think my problem is with the cordinates because when i placed the cordinates there were 2 places: Float:checkpoints and a thing with a comment saying Variables. I just placed same cordinates on both. Did i do it wrong? plz just answer ASAP
Reply
#2

Oh and btw when i do /robstore it doesnt rob it... nothing happens... And in the other robbery's theres a zone line with alot of stuff idk what it was so i removed it :S
Reply
#3

no one can guess ur code and tell what to change.. not even the creator of SAMP..

provide us with full/entire code of ur robbery system so maybe someone will be able to help you..
Reply
#4

#define CP_Lotto 45

Variable (all robbery's have cordinates here idk what they are for but ive putted here the same as in the checkpoints)
new Float:checkCoords[MAX_POINTS][4] = {
{822.4184,2.8957,1004.1797,89.0812} //Lotto
};


(something that comes next is where i puted same cordinates as b4 too but all cordinates from other robbery's are different idk why!!!)
new Float:checkpoints[MAX_POINTS][4] = {
{822.4184,2.8957,1004.1797,89.0812} //Lotto
};
new checkpointType[MAX_POINTS] = {
CP_Lotto

new RobbingLotto[MAX_PLAYERS];

new LottoRobbedRecently =0;
(idk whats this next thing but it says in comments "Reset Death variables")
RobbingLotto[playerid] =0;

(next is something that is in the /robstore command(lotto is last one)
if(getCheckpointType(playerid) != CP_BurgerShotMain && getCheckpointType(playerid) != CP_CluckinBellMain &&
getCheckpointType(playerid) != CP_Ammunation && getCheckpointType(playerid) != CP_GayDarMain &&
getCheckpointType(playerid) != CP_ZeroMain && getCheckpointType(playerid) != CP_MistysMain &&
getCheckpointType(playerid) != CP_GYM && getCheckpointType(playerid) != CP_School &&
getCheckpointType(playerid) != CP_WangCars && getCheckpointType(playerid) != CP_Train &&
getCheckpointType(playerid) != CP_Barbers && getCheckpointType(playerid) != CP_PizzaMain &&
getCheckpointType(playerid) != CP_ZipMain && getCheckpointType(playerid) != CP_VictimMain &&
getCheckpointType(playerid) != CP_BincoMain && getCheckpointType(playerid) != CP_CityHallMain &&
getCheckpointType(playerid) != CP_Jizzys && getCheckpointType(playerid) != CP_Urban &&
getCheckpointType(playerid) != CP_Lotto)

(idk what this is but i guess its just messages for callbacks? idk)
if(getCheckpointType(playerid) == CP_Lotto)
{

if(LottoRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"The Lotto has been robbed recently.");
return 1;
}
if(rrand <= 30)
{
SendClientMessage(playerid,COLOR_ERROR,"The Lotto robbery failed.");
LottoRobbedRecently =320;
return 1;
}
LottoRobbedRecently =320;
RobbingLotto[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
SetProgressBarValue(robbery[playerid],RobbingLotto[playerid]);
ShowProgressBarForPlayer(playerid,robbery[playerid]);

format(string,sizeof(string),"~p~~n~~n~~n~~n~Robbi ng Lotto.~n~~r~Finish Robbery in: %d seconds.",RobbingLotto[playerid]);
GameTextForPlayer(playerid,string,3000,3);

format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Lotto! Get there and arrest the suspect.",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);

format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Lotto ..",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_RED,string);

format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Lotto ..",PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}

(next is when we enter checkpoint i guess)
if(getCheckpointType(playerid) == CP_Lotto)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_ERROR,"You must exit your vehicle before entering a checkpoint.");
return 1;
}
SendClientMessage(playerid,COLOR_ERROR,"Type /robstore to rob the Lotto.");
return 1;
}

(this is what appears when u leave the checkpoint during robbery i guess)
if(getCheckpointType(playerid) == CP_Lotto)
{
if(RobbingLotto[playerid] >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"Lotto attempt failed. You left the checkpoint ..");
GameTextForPlayer(playerid,"~r~Lotto robbery attempt failed..",3000,5);
RobbingLotto[playerid] =0;
return 1;
}
return 1;
}

(i defintly dont know what this next is...)

//Lotto robbed recently
if(LottoRobbedRecently >= 1)
{
LottoRobbedRecently --;
}


(i think this is the robbery stuff...)

if(RobbingLotto[i] > 1)
{
RobbingLotto[i] --;
SetProgressBarValue(robbery[i],RobbingLotto[i]);
ShowProgressBarForPlayer(i, robbery[i]);

format(string,sizeof(string),"~p~~n~~n~~n~~n~Robbi ng Lotto.~n~~r~Finish Robbery in: %d seconds.",RobbingLotto[i]);
GameTextForPlayer(i,string,3000,3);
}
if(RobbingLotto[i] == 1)
{
new mrand =random(30000);
RobbingLotto[i] =0;
format(string,sizeof(string),"Lotto Robbery Complete.\nYou robbed a total of $%d from Lotto.\nWatch out for police!",mrand);
SendClientMessage(i,COLOR_RED,string);
GivePlayerMoney(i,mrand);

if(RobSkill[i] < 20)
{
SendClientMessage(i,COLOR_LIGHTBLUE,"Your robbing skill has increased. You can check /robskill to see your skill level and see what you can rob next.");
RobSkill[i] ++;
}

format(string,sizeof(string),"[POLICE RADIO] Robbery: Suspect %s(%d) has robbed a total of $%d from the Lotto! Go and arrest the suspect.",pname,i,mrand);
SendClientMessageToAllCops(string);

format(string,sizeof(string),"[ROBBERY] %s(%d) has robbed a total of $%d from Lotto! Clothes prices have rocketed! ..",pname,i,mrand);
SendClientMessageToAll(COLOR_RED,string);

format(string,sizeof(string),"4[ROBBERY] %s(%d) has robbed a total of $%d from Lotto! Clothes prices have rocketed! ..",pname,i,mrand);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
}

public ResetVariables(playerid)
{
RobbingLotto[playerid] =0;




And thats all guys plz help me
Reply
#5

Guys if u need anything else to help u understand where is my mistake PLZ tell me
Reply
#6

Guys please help me still cant rob it D:
Reply
#7

You could just make a command of /rob then make a timer/defines and then give them money within the script, It is simple.
Reply
#8

For you it can be simple but im a starter i have 1 week of scripting D:
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)