GameText Checkpoint? -
ArmandoRamiraz - 27.07.2012
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);
}
Re: GameText Checkpoint? -
ArmandoRamiraz - 27.07.2012
Sorry for double post but there has to be someone out there that knows about this?
Re: GameText Checkpoint? -
Steven82 - 27.07.2012
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.
Re: GameText Checkpoint? -
Kakioshe22 - 27.07.2012
PHP код:
new n_Checkpoint;
public OnGameModeInit()
{
SetGameModeText("Blank Script");
n_Checkpoint= CreateCheckpoint( info );
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(checkpoint == n_Checkpoint)
{
GameTextForPlayer(playerid, "Do NOT abuse the neons!", 5000, 1);
DisablePlayerCheckpoint(playerid);
}
return 1;
}
Re: GameText Checkpoint? -
Steven82 - 27.07.2012
Quote:
Originally Posted by Kakioshe22
PHP код:
new n_Checkpoint;
public OnGameModeInit()
{
SetGameModeText("Blank Script");
n_Checkpoint= CreateCheckpoint( info );
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(checkpoint == n_Checkpoint)
{
GameTextForPlayer(playerid, "Do NOT abuse the neons!", 5000, 1);
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.
Re: GameText Checkpoint? -
ArmandoRamiraz - 27.07.2012
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?
Re: GameText Checkpoint? -
Steven82 - 27.07.2012
Remove "DisablePlayerCheckpoint(playerid);".
Re: GameText Checkpoint? -
ArmandoRamiraz - 27.07.2012
Quote:
Originally Posted by Steven82
Remove "DisablePlayerCheckpoint(playerid);".
|
I should've know that haha thanks again man.