SA-MP Forums Archive
Vehicle checking - 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: Vehicle checking (/showthread.php?tid=490117)



Vehicle checking - bogushas - 25.01.2014

OnPlayerEnterCheckpoint
Код:
            case 35:
            {
            	if(IsPlayerInCheckpointEx(playerid, cpid))
                {
                	if(IsPlayerInVehicle(playerid, 440)) // if vehicle == 440
    				{
				        SetTimerEx("kraunamgps", 7000, false, "i", playerid);
				        TogglePlayerControllable(playerid,false);
				        SendClientMessage(playerid,-1,"{FFC400}»{949494} Praљome palaukti, kraumi GPS'ai.");
				    }
				    else // if vehicle not 440
				    {
				    	SendClientMessage(playerid,-1,"{FFC400}»{949494} walink");
				    }
                }	
            }
The problem is that i'm sitting in 440 vehicle, but I dont get the TimerEx ant TogglePlayerControllble. Maybe someone knows the problem?


Re: Vehicle checking - Rifa4life - 25.01.2014

The thing that concerns me is that "case". What did you put in the "switch"? As far as I know OnPlayerEnterCheckpoint does not have any other parameters than "playerid'.

By the way, every time that something is not working, put "printf("%s", name-of-the-function); and run the script. It's a simple way of debugging and checking where the scripts fails to work.


Re: Vehicle checking - bogushas - 25.01.2014

SendClientMessage(playerid,-1,"{FFC400}»{949494} walink");

I'm getting only this message.