SA-MP Forums Archive
Checkpoints wont show. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Checkpoints wont show. (/showthread.php?tid=516107)



Checkpoints wont show. - Johnson_Brooks - 29.05.2014

From the code given below you can see that the /work command is clearly for the army/cia and the pilots only .
pawn Код:
CMD:work(playerid, params[])
{
        if(WorkInfo[playerid][IsWorking] == 1)
        {
            SendClientMessage(playerid, COLOR_RED, "You're already working");
        }
        if(gTeam[playerid] == TEAM_ARMY)
        {
        if(IsPlayerInRangeOfPoint(playerid,100,-1314.2576,498.6849,18.2344) && IsPlayerInHydra(playerid))
        {
            WorkInfo[playerid][IsWorking] = 1;
            WorkInfo[playerid][Job1] = 1;
            SendClientMessage(playerid,COLOR_WHITE,"[{FFA500}FLIGHT{EEEEEE}]Complete a flight from SF Carrier to A51");
            SetPlayerCheckpoint(playerid,-1314.2576,498.6849,18.2344, 7);
            return 1;
        }
        if(IsPlayerInRangeOfPoint(playerid,100,311.3356,2049.9468,17.6406) && IsPlayerInHydra(playerid))
        {
            WorkInfo[playerid][IsWorking] = 1;
            WorkInfo[playerid][Job2] = 1;
            SendClientMessage(playerid,COLOR_WHITE,"[{FFA500}FLIGHT{EEEEEE}]Complete a flight from A51 to SF Carrier");
            SetPlayerCheckpoint(playerid,311.3356,2049.9468,17.6406, 7);
        }
        }
        if(gTeam[playerid] == TEAM_PILOT)
        {
        if(IsPlayerInRangeOfPoint(playerid,100,-1248.3126,14.4799,14.1484)) //&& IsPlayerInCivilPlane(playerid))
        {
            WorkInfo[playerid][IsWorking] = 1;
            WorkInfo[playerid][SFAtoLVA] = 1;
            SendClientMessage(playerid,COLOR_WHITE,"[{00FF00}PILOT FLIGHT{EEEEEE}]Complete a flight from SFA to LVA ");
            SetPlayerCheckpoint(playerid,-1388.9904,-202.2983,14.1484,7);
        }
        if(IsPlayerInRangeOfPoint(playerid,100,1578.9878,1535.3451,10.8305))
        {
            WorkInfo[playerid][IsWorking] = 1;
            WorkInfo[playerid][LVAtoLSA] = 1;
            SendClientMessage(playerid,COLOR_WHITE,"[{00FF00}PILOT FLIGHT{EEEEEE}]Complete a flight from LVA to LSA ");
            SetPlayerCheckpoint(playerid,1578.9878,1535.3451,10.8305,7);
        }
        if(IsPlayerInRangeOfPoint(playerid,500,1644.6799,-2413.4983,13.5547))
        {
            WorkInfo[playerid][IsWorking] = 1;
            WorkInfo[playerid][LSAtoSFA] = 1;
            SendClientMessage(playerid,COLOR_WHITE,"[{00FF00}PILOT FLIGHT{EEEEEE}]Complete a flight from LSA to SFA");
            SetPlayerCheckpoint(playerid,1644.6799,-2413.4983,13.5547,7);
        }
        }
        return 1;
}
The checkpoints display for the army but not for the normal pilots . Im not getting any errors or something .
The wrong code is somewhere in there . But what?


Re: Checkpoints wont show. - superrobot48 - 29.05.2014

pawn Код:
if(gTeam[playerid] == TEAM_ARMY)
        {
use
pawn Код:
if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_COP)
        {



Re: Checkpoints wont show. - Johnson_Brooks - 29.05.2014

Quote:
Originally Posted by superrobot48
Посмотреть сообщение
pawn Код:
if(gTeam[playerid] == TEAM_ARMY)
        {
use
pawn Код:
if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_COP)
        {
I know about that , i added it after i posted it here , what i want is to know why the checkpoints wont show for the PILOTS.


Re: Checkpoints wont show. - DavidBilla - 29.05.2014

I think using switch-case function might solve your problem...


Re: Checkpoints wont show. - Johnson_Brooks - 29.05.2014

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
I think using switch-case function might solve your problem...
Thats not the problem . If that was it , which isn't , the army players wouldn't be able to see the checkpoints either.


Re: Checkpoints wont show. - DavidBilla - 29.05.2014

Well while playing as army are you able to see only the first checkpoint?


Re: Checkpoints wont show. - Johnson_Brooks - 29.05.2014

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
Well while playing as army are you able to see only the first checkpoint?
As an army/cia member i can see all the checkpoints for the army .
I can see :
The checkpoints from:
SF Carrier to A51
A51 to SF Carrier .

I cant see:
SFA TO LVA
LVA TO LSA
LSA TO SFA.
(The rest of the checkpoints)


Re: Checkpoints wont show. - DavidBilla - 29.05.2014

else if(gTeam[playerid] == TEAM_PILOT)

^^ this will work,check it out.


Re: Checkpoints wont show. - Johnson_Brooks - 29.05.2014

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
else if(gTeam[playerid] == TEAM_PILOT)

^^ this will work,check it out.
It didn't work .


Re: Checkpoints wont show. - Lacamora - 29.05.2014

change Int to Float

Код:
if(IsPlayerInRangeOfPoint(playerid,100.0,................

SetPlayerCheckpoint(playerid,-1314.2576,498.6849,18.2344, 7.0);