GameTextForPlayer(playerid, "~b~~h~Clothing Shop~n~~w~Outfit: ~g~$200~n~~r~/clothes~n~(/items for hats, glases etc..)", 3000, 5);
#define CHECKPOINT_CLOTHES 128
public OnPlayerEnterCheckpoint(playerid)
{
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);
}
}
}
new Float:CheckpointAreas[6][6] = {
{207.5909,-110.5292,1005.7423,217.4284,-99.3221,1003.7321}, // Binco
{204.5461,-167.7819,1000.7054,204.2256,-159.8634,999.5313}, // Didier Sachs
{207.1015,-139.8937,1003.5370,199.2238,-128.6456,1002.9193}, // Pro Laps
{203.9850,-50.3426,1002.0959,203.7788,-43.4468,1001.5625}, // Suburban
{226.8983,-7.9157,1002.3958,206.3996,-8.5240,1000.2086}, // Victim
{161.2953,-95.8920,1001.9630,161.2016,-83.5888,1000.8359} // ZIP
};
new CheckpointAreaType[6][1] = {
{CHECKPOINT_CLOTHES},
{CHECKPOINT_CLOTHES},
{CHECKPOINT_CLOTHES},
{CHECKPOINT_CLOTHES},
{CHECKPOINT_CLOTHES},
{CHECKPOINT_CLOTHES}
};
forward LoadChecks(playerid);
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]);
}
}
return 1;
}
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; }
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; } edit: you could btw use "default: DisablePlayerCheckpoint(playerid);" instead of defining "CHECKPOINT_NONE" |
printf("set to number %d", i);
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; }
you did correct my typo from "prinf" to "printf" didn't you? (just to be sure)...
Then at least we know that "OnPlayerEnterCheckpoint" is not called ![]() Are you using any streamer or so? |
maybe that's influencing the system in a way, although I have no clue tbh...
I'd try to work with the dynamic checkpoints only... You could also try a print("called"); message on the "OnPlayerEnterDynamicCP" to check whether that is somehow called when entering the normal CP... |