GameText Checkpoint?
#1

Ok, I am working on making a checkpoint that when someone enters it, it will send a gametext message to them. Im sure im doing it wrong because when I go to my server and try it, it doesnt work lol. But I dont get any errors. Someone help me here please.

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,5, -2026.9030,132.2212,28.8429))
    {
        GameTextForPlayer(playerid, "Do NOT abuse the neons!", 5000, 1);
		DisablePlayerCheckpoint(playerid);
	}
Reply
#2

Sorry for double post but there has to be someone out there that knows about this?
Reply
#3

You are doing it wrong obviously. You need to use a variable to detect what the checkpoint is. Then you do something like:

pawn Код:
new NeonCheckpoint[MAX_PLAYERS];

public OnPlayerEnterCheckpoint(playerid)
{
    if(NeonCheckpoint[playerid] == 1)
    {
        GameTextForPlayer(playerid, "Do NOT abuse the neons!", 5000, 1);
        DisablePlayerCheckpoint(playerid);
    }
    return 1;
}
Now your 'SetPlayerCheckpoint' code doesn't need any chaning. But you need t add your new variable underneath it and set it to '1'. Like the example below shows.

pawn Код:
SetPlayerCheckpoint(playerid, 1.0, x, y, z);
NeonCheckpoint[playerid] = 1;

That is one method of doing it. And going to be the easiest to add for your script.
Reply
#4

PHP код:
new n_Checkpoint;
public 
OnGameModeInit()
{
    
SetGameModeText("Blank Script");
        
n_CheckpointCreateCheckpointinfo );
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    if(
checkpoint == n_Checkpoint)
    {
          
GameTextForPlayer(playerid"Do NOT abuse the neons!"50001);
      
DisablePlayerCheckpoint(playerid);
    }
    return 
1;

Reply
#5

Quote:
Originally Posted by Kakioshe22
Посмотреть сообщение
PHP код:
new n_Checkpoint;
public 
OnGameModeInit()
{
    
SetGameModeText("Blank Script");
        
n_CheckpointCreateCheckpointinfo );
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    if(
checkpoint == n_Checkpoint)
    {
          
GameTextForPlayer(playerid"Do NOT abuse the neons!"50001);
      
DisablePlayerCheckpoint(playerid);
    }
    return 
1;

I am sorry but your code is way wrong. First, there isn't even a CreateCheckpoint function in the default SA-MP native functions are you just guessing stuff? Second, that would mean the checkpoint is there ALL the time. Which, if he wants they make things like the streamer plugin.
Reply
#6

I knew I was doing something wrong but just didnt know what. Thanks guys for helping. I'll try to get it now. +Rep

EDIT: Ok, I have the checkpoint working and the gametext (Thanks Steven) but it only shows once. Is there a way to make it show everytime someone goes into the point?
Reply
#7

Remove "DisablePlayerCheckpoint(playerid);".
Reply
#8

Quote:
Originally Posted by Steven82
Посмотреть сообщение
Remove "DisablePlayerCheckpoint(playerid);".
I should've know that haha thanks again man.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)