17.01.2010, 03:46
I have a problem with the callback "public OnPlayerLeaveCheckpoint(playerid)"
I'm using Dragstas checkpoint streamer and i cannot use that callback to do anything since it's not included in his streamer.
So the problem is, is there a way to work around this? So i can use that callback and make it work with the CPS checkpoints i made?
If you don't get what i mean, here take a look:
Here's a command. /robhall if you leave the checkpoint the timer should stop working and it should say "You've left the checkpoint" but i cannot do that. any ideas?
I'm using Dragstas checkpoint streamer and i cannot use that callback to do anything since it's not included in his streamer.
So the problem is, is there a way to work around this? So i can use that callback and make it work with the CPS checkpoints i made?
If you don't get what i mean, here take a look:
Here's a command. /robhall if you leave the checkpoint the timer should stop working and it should say "You've left the checkpoint" but i cannot do that. any ideas?
Код:
if(strcmp(cmdtext, "/robhall", true) == 0) { if(IsSpawned[playerid] == 0) { SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command"); return 1; } if(Jailed[playerid] == 1) { SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command"); return 1; } if(cuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_ERROR, "You cannot use this command while you are handcuffed"); return 1; } if(!IsPlayerInCheckpoint(playerid)) { SendClientMessage(playerid,COLOR_ERROR,"You are not in the LS City Hall robbing checkpoint"); return 1; } if(gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_MEDIC || gTeam[playerid] == TEAM_CASSEC || gTeam[playerid] == TEAM_JAILTK) { SendClientMessage(playerid,COLOR_ERROR,"You cannot rob LS City Hall"); return 1; } TogglePlayerCheckpoint(playerid, CP4, bool: true); { if(cityhallrobbedrecent >= 1) { SendClientMessage(playerid,COLOR_ERROR,"LS City Hall has been robbed recently. Try again later"); return 1; } new challrand = random(100); if(challrand >=0 && challrand <=10) { SendClientMessage(playerid, 0xA9A9A9AA, "|_LS City Hall Robbery Failed_|"); SendClientMessage(playerid,COLOR_ERROR,"Your attempt to rob LS City Hall has failed"); return 1; } if(challrand >=11 && challrand <=100) { new hallrobbber[30]; new pcol = GetPlayerColor(playerid); GetPlayerName(playerid,hallrobbber,30); new plwl = GetPlayerWantedLevel(playerid); SetPlayerWantedLevel(playerid, plwl +4); robbinghall[playerid] =15; SendClientMessage(playerid,0x00C7FFAA,"You are now robbing LS City Hall. The Police have been dispatched and will be on route right now"); SendClientMessage(playerid,0x00C7FFAA,"Stay in the checkpoint to complete the robbery..."); plwl = GetPlayerWantedLevel(playerid); cityhallrobbedrecent = 240; SendClientMessage(playerid, 0xA9A9A9AA, "|_Crime Commited_|"); format(szstring, sizeof(szstring), "(LS CITY HALL ROBBERY) Wanted Level %d",plwl); SendClientMessage(playerid,pcol,szstring); commitedcrimerecently[playerid] +=120; printf("%s(%d) has started a LS City Hall robbery",hallrobbber,playerid); for(new i=0;i<MAX_PLAYERS;i++) { if(LawEnforcementRadio[i] == 1) { new szstring1[256]; new szstring2[256]; format(szstring1, sizeof(szstring1), "DISPATCH: (ROBBERY IN PROGRESS) Suspect: %s(%d)",hallrobbber,playerid); format(szstring2, sizeof(szstring2), "ALL UNITS: Please respond to LS City Hall and arrest %s(%d)",hallrobbber,playerid); SendClientMessage(i, COLOR_ROYALBLUE, szstring1); SendClientMessage(i, COLOR_ROYALBLUE, szstring2); robberrank[i] +=1; oscore = GetPlayerScore(playerid); SetPlayerScore(playerid, oscore +1); } } } } return 1; }