Checkpoint help
#4

Quote:
Originally Posted by Sascha
Посмотреть сообщение
try figuring it out with some debug messages...
Код:
public LoadChecks(playerid) 
{ 
    for(new i = 0; i < sizeof(CheckpointAreas); i++) 
    { 
        if(IsPlayerInRangeOfPoint(playerid,20.0,CheckpointAreas[i][0],CheckpointAreas[i][1],CheckpointAreas[i][2])) 
        { 
            SetPlayerCheckpoint(playerid,CheckpointAreas[i][3],CheckpointAreas[i][4],CheckpointAreas[i][5],1.0); 
            SetPVarInt(playerid, "Checkpoint", CheckpointAreaType[i][0]); 
            printf("set to number %d", i);
        } 
    } 
    return 1; 
}
Код:
public OnPlayerEnterCheckpoint(playerid) 
{ 
      prinf("pvar 'Checkpoint' has value %d - Clothes should be %d", GetPVarInt(playerid, "Checkpoint"), CHECKPOINT_CLOTHES);
     switch(GetPVarInt(playerid, "Checkpoint")) 
        { 
            case CHECKPOINT_NONE: DisablePlayerCheckpoint(playerid); 
               case CHECKPOINT_CLOTHES: 
               { 
               GameTextForPlayer(playerid, "~b~~h~Clothing Shop~n~~w~Outfit: ~g~$200~n~~r~/clothes~n~(/items for hats, glases etc..)", 3000, 5); 
              } 
        } 
        retrun 1;
}
and check the results to figure out where it's failing to work/save


edit: you could btw use "default: DisablePlayerCheckpoint(playerid);" instead of defining "CHECKPOINT_NONE"
Only print this one
Код:
printf("set to number %d", i);
Something is wrong here

Код:
public OnPlayerEnterCheckpoint(playerid) 
{ 
      prinf("pvar 'Checkpoint' has value %d - Clothes should be %d", GetPVarInt(playerid, "Checkpoint"), CHECKPOINT_CLOTHES);
     switch(GetPVarInt(playerid, "Checkpoint")) 
        { 
            case CHECKPOINT_NONE: DisablePlayerCheckpoint(playerid); 
               case CHECKPOINT_CLOTHES: 
               { 
               GameTextForPlayer(playerid, "~b~~h~Clothing Shop~n~~w~Outfit: ~g~$200~n~~r~/clothes~n~(/items for hats, glases etc..)", 3000, 5); 
              } 
        } 
        retrun 1;
}
Reply


Messages In This Thread
Checkpoint help - by N0FeaR - 26.01.2016, 13:59
Re: Checkpoint help - by Sascha - 26.01.2016, 15:33
Re: Checkpoint help - by Runn3R - 26.01.2016, 16:42
Re: Checkpoint help - by N0FeaR - 26.01.2016, 19:54
Re: Checkpoint help - by Sascha - 27.01.2016, 07:00
Re: Checkpoint help - by N0FeaR - 27.01.2016, 08:42
Re: Checkpoint help - by Sascha - 27.01.2016, 14:50
Re: Checkpoint help - by N0FeaR - 27.01.2016, 16:29
Re: Checkpoint help - by Sascha - 28.01.2016, 09:00

Forum Jump:


Users browsing this thread: 6 Guest(s)