Race Checkpoints issue
#1

So i was making checkpoints for my license system, and for some reason the last one i have for the finish keeps on spamming the messages of the previous one.I've made both to get destroyed upon player entering them but still, i do not know why is it having the function the other one had.

I create the first checkpoint when the player clicks the yes button in a dialog.
Код:
dscp1[1] = CreateDynamicRaceCP(0, -1622.5999,1183.9554,6.7550, -1622.5999,1183.9554,6.7550, 10, 0, 0, -1, 5000, -1);
Then under OnPlayerEnterDynamicRaceCP
Код:
public OnPlayerEnterDynamicRaceCP(playerid, checkpointid)
{
	if(checkpointid == dscp1[1])
	{
		SendClientMessage(playerid, COLOR_YELLOW,"School: {FFFFFF}Good, now head back to the school.");
		DestroyDynamicRaceCP(dscp1[1]);
		dscp2[2] = CreateDynamicRaceCP(1, -2047.2490,-76.7162,34.7426, -2047.2490,-76.7162,34.7426, 10, 0, 0, -1, 5000, -1);
	}
	else if(checkpointid == dscp2[2])
	{
		DestroyDynamicRaceCP(dscp2[2]);
		GameTextForPlayer(playerid, "~g~Passed",5000,0);
	}
	return 1;
}
Reply
#2

use default OnPlayerEnterRaceCheckpoint

and try what i did, you create a variable every time you have to enter the CP, and if it has a certain value set by you to go its CP, I hope you understand what I meant

Ex:
PHP код:

if(CP[playerid] == 300)//Exam_01
            
{
                
DisablePlayerRaceCheckpoint(playerid);
                
CP[playerid] = 301;
                
SetPlayerRaceCheckpoint(playerid0920.8195,-1588.7004,13.1235897.0294,-1570.6616,13.13154.0);
                
GameTextForPlayer(playerid,"~h~~r~1/23",1500,1);
            }
            else if(
CP[playerid] == 301)//Exam_02
            
{
                
DisablePlayerRaceCheckpoint(playerid);
                
CP[playerid] = 302;
                
SetPlayerRaceCheckpoint(playerid0897.0294,-1570.6616,13.1315847.8700,-1600.5890,13.13164.0);
                
GameTextForPlayer(playerid,"~h~~r~1/23",1500,1);
            } 
Reply
#3

Quote:
Originally Posted by Florin48
Посмотреть сообщение
use default OnPlayerEnterRaceCheckpoint

and try what i did, you create a variable every time you have to enter the CP, and if it has a certain value set by you to go its CP, I hope you understand what I meant

Ex:
PHP код:

if(CP[playerid] == 300)//Exam_01
            
{
                
DisablePlayerRaceCheckpoint(playerid);
                
CP[playerid] = 301;
                
SetPlayerRaceCheckpoint(playerid0920.8195,-1588.7004,13.1235897.0294,-1570.6616,13.13154.0);
                
GameTextForPlayer(playerid,"~h~~r~1/23",1500,1);
            }
            else if(
CP[playerid] == 301)//Exam_02
            
{
                
DisablePlayerRaceCheckpoint(playerid);
                
CP[playerid] = 302;
                
SetPlayerRaceCheckpoint(playerid0897.0294,-1570.6616,13.1315847.8700,-1600.5890,13.13164.0);
                
GameTextForPlayer(playerid,"~h~~r~1/23",1500,1);
            } 
Thanks man. +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)