PDA

View Full Version : Checkpoint Problem


nor15
05/02/2013, 11:24 PM
I downloaded a gamemode it was in SF , then i started to change the checkpoints but for example changing the Ammunation Robbing CheckPoint

I got it defined and i got the FloatCheckCoords and FlootCheckpoints

but when i use /robshop nothing happened , Dunno why ?
can any one help ?

nor15
06/02/2013, 01:10 AM
No one know what is the Problem O.o ?

AphexCCFC
06/02/2013, 01:13 AM
We are not psychic, post your code ;)

nor15
06/02/2013, 01:43 AM
This is the check pointsnew Float:checkCoords[MAX_POINTS][4] = {
{293.0301,-38.5132,294.7196,-37.0548}, //Ammunation
and new Float:checkpoints[MAX_POINTS][4] = {
{293.6689,-37.6174,1001.5156,3.0}, //Ammunation

The command if(getCheckpointType(playerid) == CP_Ammunation)
{
if(zones[current_zone][zone_name] == zones[241][zone_name] || zones[current_zone][zone_name] == zones[242][zone_name] ||
zones[current_zone][zone_name] == zones[243][zone_name])
{
if(AmmunationRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"The Ammunation has been robbed recently.");
return 1;
}
if(RobSkill[playerid] < 20)
{
SendClientMessage(playerid,COLOR_ERROR,"You must have a robbing skill level of 20 to rob Ammunation. Check /robskill to see what you can rob.");
return 1;
}
AmmunationRobbedRecently =320;
RobbingAmmunation[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"~w~Robbing Ammunation.~n~~r~Finish Robbery in: %d seconds.~n~~b~Police are on the way.",RobbingAmmunation[playerid]);
GameTextForPlayer(playerid, string, 3000, 3);

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

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

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

mrtms
06/02/2013, 03:06 AM
I dont see a checkpoint setter anywhere in the code. Here are the parameters:

http://wiki.sa-mp.com/wiki/Function:SetPlayerCheckpoint

nor15
06/02/2013, 03:17 AM
I dont see a checkpoint setter anywhere in the code. Here are the parameters:

http://wiki.sa-mp.com/wiki/Function:SetPlayerCheckpoint

HERE

public checkpointUpdate()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
for(new j=0; j < MAX_POINTS; j++)
{
if(isPlayerInArea(i, checkCoords[j]))
{
if(playerCheckpoint[i]!=j)
{
DisablePlayerCheckpoint(i);
SetPlayerCheckpoint(i, checkpoints[j][0],checkpoints[j][1],checkpoints[j][2],checkpoints[j][3]);
playerCheckpoint[i] = j;
}
}
else
{
if(playerCheckpoint[i]==j)
{
DisablePlayerCheckpoint(i);
playerCheckpoint[i] = 999;
}
}
}
}
}
}
The checkpoint is found but when i use the command /robstore nothing happen

mrtms
06/02/2013, 03:23 AM
Well personally at this point what I'd try doing is printing a buncb of variables and figure out where it's ending and if it's even respond to your if statement (debugging). print("1"); and then just order the different numbers so you can trace where in the scriot that is breaking. That if statement to me with the checkcoords looks wrong, never really seen an array be done like that.

nor15
06/02/2013, 03:25 AM
Well personally at this point what I'd try doing is printing a buncb of variables and figure out where it's ending and if it's even respond to your if statement (debugging). print("1"); and then just order the different numbers so you can trace where in the scriot that is breaking. That if statement to me with the checkcoords looks wrong, never really seen an array be done like that.

so what i must edit ?

mrtms
06/02/2013, 03:34 AM
if(isPlayerInArea(i,*checkCoords[j]))

Add print("1");

And after it add print("2");

Then compile the script and do the command. If it gets to the number 2 then you know its something with the setplayercheckpoint and if it doesnt then you know its something with isPlayerInArea. If it doesn't go to either then you know its something with the cmd itself. All I really know off the code you gave me.

nor15
06/02/2013, 03:39 AM
;isten man this gamemode is really based in SF and i downloaded it from here it works fine and i hosted it but when i put the checkpoints in LS they don't work

nor15
06/02/2013, 03:07 PM
no one else know ?