Checkpoint Problem
#1

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 ?
Reply
#2

No one know what is the Problem O.o ?
Reply
#3

We are not psychic, post your code
Reply
#4

This is the check points
PHP код:
new Float:checkCoords[MAX_POINTS][4] = {
{
293.0301,-38.5132,294.7196,-37.0548}, //Ammunation 
and
PHP код:
new Float:checkpoints[MAX_POINTS][4] = {
{
293.6689,-37.6174,1001.5156,3.0}, //Ammunation 
The command
PHP код:
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(playeridstring30003);
            
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
Reply
#5

I dont see a checkpoint setter anywhere in the code. Here are the parameters:

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
Reply
#6

Quote:
Originally Posted by mrtms
Посмотреть сообщение
I dont see a checkpoint setter anywhere in the code. Here are the parameters:

https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
HERE

PHP код:
public checkpointUpdate()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
          {
              for(new 
j=0MAX_POINTSj++)
              {
                if(
isPlayerInArea(icheckCoords[j]))
                   {
                       if(
playerCheckpoint[i]!=j)
                    {
                        
DisablePlayerCheckpoint(i);
                        
SetPlayerCheckpoint(icheckpoints[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
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by mrtms
Посмотреть сообщение
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 ?
Reply
#9

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.
Reply
#10

;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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)