OnPlayerEnterCheckpoint
#1

I Have problem with checkpoints, when player enter checkpoint nothing happens.

Race checkpoints work fine, but this callback "OnPlayerEnterCheckpoint" doesn't react...


CODE

VIDEO

This part showed in the video is a bus driver job, and its starts from
Код:
case 14: {
                print("dobro0");
			    if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 437 && GetPlayerState( playerid ) == 2 ) {
			        print("dobro1");

			        if( BusLinija[ playerid ] < 11 ) {
						Fusion_DisablePlayerCheckpoint( playerid );
						BusLinija[ playerid ]++;
						CheckpointStatus[ playerid ] = 14;
					}
                    print("dobro2");
					if( BusLinija[ playerid ] == 2 ) Fusion_SetPlayerCheckpoint( playerid, 963.2554, -1330.4203, 13.4962, 5.0 );
					else if( BusLinija[ playerid ] == 3 ) Fusion_SetPlayerCheckpoint( playerid, 1222.1409, -1284.2852, 13.5143, 5.0 );
					else if( BusLinija[ playerid ] == 4 ) Fusion_SetPlayerCheckpoint( playerid, 1426.8865, -1244.3213, 13.5173, 5.0 );
					else if( BusLinija[ playerid ] == 5 ) Fusion_SetPlayerCheckpoint( playerid, 1346.6564, -926.8917, 35.0315, 5.0 );
					else if( BusLinija[ playerid ] == 6 ) Fusion_SetPlayerCheckpoint( playerid, 1082.9972, -945.1513, 42.7620, 5.0 );
					else if( BusLinija[ playerid ] == 7 ) Fusion_SetPlayerCheckpoint( playerid, 394.6435, -1344.8381, 14.7427, 5.0 );
					else if( BusLinija[ playerid ] == 8 ) Fusion_SetPlayerCheckpoint( playerid, 346.2153, -1648.3312, 33.1769, 5.0 );
					else if( BusLinija[ playerid ] == 9 ) Fusion_SetPlayerCheckpoint( playerid, 1119.5483, -1708.8313, 13.5159, 5.0 );
					else if( BusLinija[ playerid ] == 10 ) Fusion_SetPlayerCheckpoint( playerid, 921.5195, -1713.4103, 13.5967, 5.0 );
					else if( BusLinija[ playerid ] == 11 ) {

					    new time = gettime( );
				        new ostatak = ( NovoVreme[ playerid ] - ( time - StaroVreme[ playerid ] ) );
				        if( ( time - StaroVreme[ playerid ] ) < NovoVreme[ playerid ] ) {
					    	SendErrorMessage( playerid, "Dosli ste ranije na marker nego sto je predvidjeno. " );
					    	SendErrorMessage( playerid, "Sacekajte jos %d sekundi i udjite ponovo u marker.", ostatak );
					    	format( globalstring, sizeof( globalstring ), "| "col_server"x"col_white"Game"col_server"Warden "col_acheat"| %s[ID: %d] je stigao na marker pre vremena( za %d od %d sekundi ).", ImeIgraca( playerid ), playerid, (NovoVreme[ playerid ]-ostatak), NovoVreme[ playerid ] );
			        		AdminPoruka( ANTICHEAT, globalstring );
							return 1;
					    }
                        print("dobro3");
					    Fusion_SetVehicleToRespawn( GetPlayerVehicleID( playerid ) );
					    Fusion_DisablePlayerCheckpoint( playerid );
					    TogglePlayerControllable( playerid, true );
					    BusLinija[ playerid ] = 0;
					    CheckpointStatus[ playerid ] = 0;
					    Fusion_KillTimer( BusVozac[ playerid ] );

					    new bonus = random( 400 );
                        if(ddeal_busvozac == true)
						{
		                    //PlayerInfo[ playerid ][ xPlatniRacun ] += (PLATA_BUSVOZAC+bonus)*2;
							
							DajIgracuPlatu(playerid);
							SavePlayer( playerid ); update_sm_info_tds(playerid);
		                    PlayerInfo[ playerid ][ xPosaoPoen ]++;
							//format( globalstring, sizeof( globalstring ), ""col_job"Uspesno ste zavrsili bus liniju!(DAILY DEAL - PLATA*2)\n\n"col_white"Plata: "col_job"%d$\n"col_white"Bonus: "col_job"%d$", PLATA_BUSVOZAC*2, bonus );
							//SPD( playerid, 0, DSMSG, D_NASLOV, globalstring, "Ok", "" );
						}
						else if(ddeal_busvozac == false)
						{
		                    //PlayerInfo[ playerid ][ xPlatniRacun ] += (PLATA_BUSVOZAC+bonus);
		                    DajIgracuPlatu(playerid);
		                    PlayerInfo[ playerid ][ xPosaoPoen ]++;
							SavePlayer( playerid ); update_sm_info_tds(playerid);
							//format( globalstring, sizeof( globalstring ), ""col_job"Uspesno ste zavrsili bus liniju!\n\n"col_white"Plata: "col_job"%d$\n"col_white"Bonus: "col_job"%d$", PLATA_BUSVOZAC, bonus );
							//SPD( playerid, 0, DSMSG, D_NASLOV, globalstring, "Ok", "" );
						}
						StaroVreme[ playerid ] = 0;
    					NovoVreme[ playerid ] = 0;

    					BussinesJobMoney( POSAO_BUSVOZAC, ((PLATA_BUSVOZAC+bonus)/10) );
					    return 1;
					}
					print("dobro4");
					TogglePlayerControllable( playerid, false );
					BusVozac[ playerid ] = SetTimerEx( "UtovarBus", 5000, false, "d", playerid );
					GameTextForPlayer( playerid, "~y~Stanica", 5000, 3 );
			    }
			}
Reply
#2

for Race Checkpoints, OnPlayerEnterRaceCheckpoint is the callback and for normal checkpoint, its OnPlayerEnterCheckpoint.
Reply
#3

I know that, but im just saying that normal checkpoints wont work, but race checkpoints work with no problems.. so when i enter normal checkpoint with bus(video above) it should create another checkpoint at diferent location, but it just ignores all callback(no showing prints in the console of the start OnPlayerEnterCheckpoint)
Reply
#4

GetPlayerState(playerid) == 2 or PLAYER_STATE_DRIVER

Код:
  if( GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 437 && GetPlayerState( playerid ) == 2 )
Reply
#5

Its not that, doesnt show print on the start of onplayerentercheckpoint, so it must be something else.. is it posible to YSF to make that kind of problem? I suspect on that.. bc everything worked yesterday..
Reply
#6

It's more likely that it's your code than YSF.
Reply
#7

I make dialy backups, so if its my code then it would be working on backup? but it doesn't, also i did not change anything in that callback or done anything recently with checkpoints.
Reply
#8

where is this case placed and which part is not working?
Reply
#9

'backup', by what method... Because if it's not Git/SVN, it has no relevance here.

Don't take the point personally... You've got a code issue, there's no way that YSF should cause it, unless you have a corrupt include, which is far less likely than the code you're working on being bugged.

Version tracking with Git or SVN wouldn't 'fix' the issue, but it tracks changes to your code, and is quite useful overall.
Reply
#10

@Mugala This case is placed in OnPlayerEnterCheckpoint, you can see al callback here https://pastebin.com/YYGhdJ2P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)