04.06.2014, 18:38
Hello. I'm having an issue with dynamic checkpoints. The issue is when I enter a specific checkpoint, it does what it's suppose too AND it does what the previous CP ID is suppose too. It's a bit strange. Its like using both CP ID's at once.
I've assigned variables to each, so I'm not too sure why they aren't working. Is there a bug I should be aware of? I read over my code a dozen times and no CP variables were misplaced, at all. What could be causing this?
If you need more code, let me know. I'll post what happens when they ENTER the checkpoint.
Thanks for any help.
I've assigned variables to each, so I'm not too sure why they aren't working. Is there a bug I should be aware of? I read over my code a dozen times and no CP variables were misplaced, at all. What could be causing this?
If you need more code, let me know. I'll post what happens when they ENTER the checkpoint.
pawn Код:
if(checkpointid == mCP[playerid])
{
if(pJob[playerid][mMailStock] > 0 ) return SCM(pid,COLOR_GREY, "[ERROR]: You're already loaded with stock.");
TIMER_MAILMANSTOCK = SetTimerEx("MailManStockTimer", 7000, false, "i", playerid);
new string[128];
format(string,sizeof(string), "*%s waits as the mail men deliver the stock into his truck*", GetName(playerid));
SCM(playerid,COLOR_GREEN, "{FFFFFF}[Job]: {0E7A04}Please wait while your stock is loaded into your truck.");
SendLocalClientMessage(30.0, COLOR_ME, playerid, string);
TogglePlayerControllable(pid, false);
}
if(checkpointid == mCPDeliver[playerid])
{
if(pJob[playerid][mMailStock] < 1)
{
SCM(pid,COLOR_RED, "You're out of stock. Reload at the mail man job location.");
DestroyDynamicCP(mCPDeliver[playerid]);
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SCM(pid,COLOR_GREY, "[ERROR]: You need to be on foot to deliver mail.");
return 1;
}
pJob[playerid][mMailStock] --;
CreateMailCP(playerid);
new string[128];
format(string,sizeof(string), "Remaining stock: %d", pJob[playerid][mMailStock]);
SCM(pid, COLOR_GREY, string);
}
return 1;