Checkpoint help
#1

When i walk into the checkpoint nothing happend this should come up when i walk into it mabye u guys can help me thanks in advance!
Код:
						GivePlayerMoney(playerid,-500);
							GameTextForPlayer(playerid, "~r~-$500.", 5000, 1);
							SendClientMessage(playerid,COLOR_LIGHTBLUE,"Head outside to the vehicles and begin your driving test.");
PHP код:
case CHECKPOINT_DMV:
             {
                switch(
GetPVarInt(playerid"DriveTest"))
                {
                    case 
0:
                    {
                        
//if(GetPVarInt(playerid, "DriveLic") == 1) return SendClientMessage(playerid,COLOR_GREY,"You already have a license.");
                        
if(GetPlayerMoney(playerid) >= 500)
                        {
                            
GivePlayerMoney(playerid,-500);
                            
GameTextForPlayer(playerid"~r~-$500."50001);
                            
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Head outside to the vehicles and begin your driving test.");
                            
SetPVarInt(playerid"DriveTest"1);
                        }
                        else 
SendClientMessage(playerid,COLOR_GREY,"You need $500 to do the test.");
                    }
                    case 
2SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2084.9592,-1878.3547,13.1988,5.0);
                      case 
3SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2085.4121,-1794.3701,13.2646,5.0);
                       case 
4SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2061.9492,-1749.2493,13.2614,5.0);
                       case 
5SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1981.0918,-1749.8353,13.2578,5.0);
                       case 
6SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1909.6647,-1749.3674,13.2578,5.0);
                       case 
7SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1839.1298,-1749.5602,13.2578,5.0);
                       case 
8SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1824.8691,-1726.7939,13.2578,5.0);
                       case 
9SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1824.5071,-1683.5410,13.2579,5.0);
                       case 
10SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1824.3438,-1641.0778,13.2579,5.0);
                       case 
11SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1833.2657,-1550.5740,13.2541,5.0);
                       case 
12SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1829.5264,-1457.5667,13.2478,5.0);
                       case 
13SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1758.8507,-1440.8928,13.2418,5.0);
                       case 
14SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1692.9579,-1438.1527,13.2586,5.0);
                       case 
15SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1608.6155,-1430.0377,13.2774,5.0);
                       case 
16SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1608.3904,-1372.4042,14.8665,5.0);
                       case 
17SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1609.6169,-1332.5227,17.1635,5.0);
                       case 
18SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1628.3630,-1305.7866,16.5843,5.0);
                       case 
19SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1684.5138,-1305.9886,13.5838,5.0);
                       case 
20SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1744.9943,-1300.3932,13.3428,5.0);
                       case 
21SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1784.3658,-1281.6708,13.3438,5.0);
                       case 
22SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1866.8568,-1262.2316,13.2581,5.0);
                       case 
23SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2000.2797,-1262.5417,23.6994,5.0);
                       case 
24SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2065.5117,-1284.9235,23.6953,5.0);
                       case 
25SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2065.6699,-1359.4589,23.6938,5.0);
                       case 
26SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2109.7046,-1411.3933,23.7027,5.0);
                       case 
27SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2110.0352,-1490.2906,23.6909,5.0);
                       case 
28SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2109.9658,-1599.6238,25.0737,5.0);
                       case 
29SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2083.6077,-1772.7036,13.2608,5.0);
                       case 
30SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2057.0925,-1808.8322,13.2577,5.0);
                       case 
31SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1986.9674,-1809.8187,13.2578,5.0);
                       case 
32SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1958.8763,-1827.8669,13.2578,5.0);
                       case 
33SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1959.6487,-1897.9441,13.2578,5.0);
                       case 
34SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,1973.6750,-1934.2632,13.2576,5.0);
                       case 
35SetPVarInt(playerid"DriveTest"GetPVarInt(playerid"DriveTest")+1), SetPlayerCheckpoint(playerid,2055.5962,-1915.2133,13.4219,5.0);
                    case 
36:
                       {
                          new 
Float:health;
                         
GetVehicleHealth(GetPlayerVehicleID(playerid),health);
                           
DisablePlayerCheckpoint(playerid);
                         if(
health <= 500.0PrintTestResult(playerid2"Vehicle Is Too Damaged");
                          else if(
GetPVarInt(playerid"TestTime") >= 301PrintTestResult(playerid2"Too Slow");
                           else if(
GetPVarInt(playerid"TestTime") <= 90PrintTestResult(playerid2"Too Fast");
                        else if(
GetPVarFloat(playerid,"TestSpeed") >= 95.0PrintTestResult(playerid2"Broke Speed Limit");
                           else
                        {
                            
PlayAudioStreamForPlayerEx(playerid"http://rebound-rp.com/r-rp-soundeffects/theme.mp3");
                             
PrintTestResult(playerid1"All Qualifications Correct");
                              
SetPVarInt(playerid"DriveLic"1);
                        }
                        
TogglePlayerAllDynamicCPs(playeridtrue);
                        
SetPVarInt(playerid"Checkpoint"CHECKPOINT_NONE);
                        
SetVehicleToRespawn(GetPlayerVehicleID(playerid)); 
enum
PHP код:
new Float:CheckpointAreas[1][6] = {
{-
2026.7859,-104.3167,1035.1719, -2033.0184,-117.7156,1035.1719},
};
new 
CheckpointAreaType[1][1] = {
{
CHECKPOINT_DMV},
}; 
callback
PHP код:
forward LoadChecks(playerid);
public 
LoadChecks(playerid)
{
    for(new 
0sizeof(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;

Reply
#2

Try that better, I'm not really sure.

Код:
if (IsPlayerInCheckpoint(playerid))
{
  GivePlayerMoney(playerid, -500);
}
IfPlayerInRangeOfPoint, only defines if a player is in range of the checkpoint you placed, however, IsPlayerInCheckPoint confirms the above theory.

I'm not sure, atleast that's how I use it in my GM.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)