[Help]Race Checkpoints not showing in Map
#1

Hello Every One
i Want know how to showing Race CP in map cuz its not showing
i made it random CP Race
help +rep
Reply
#2

Hello!

Look at this page:
https://sampwiki.blast.hk/wiki/SetPlayerRaceCheckpoint

Mencent
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
error
Quote:

F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(35) : warning 213: tag mismatch
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(35) : warning 202: number of arguments does not match definition
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(35) : warning 202: number of arguments does not match definition
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(35) : warning 202: number of arguments does not match definition

line 35
PHP код:
new test =  SetPlayerRaceCheckpoint(STREAMER_TYPE_RACE_CPNextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand][0],NextKidnapp[rand][1],NextKidnapp[rand][2],5.0,-1,-1,-1,100); 
Reply
#4

Dynamic race checkpoints differ. Also because it'll cause run time error 4 if you use +1 index for the next x/y/z, do something like:
pawn Код:
if (sizeof (NextKidnapp) - 1 == rand) SetPlayerRaceCheckpoint(playerid, 0, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand - 1][0],NextKidnapp[rand - 1][1],NextKidnapp[rand - 1][2], 5.0);
else SetPlayerRaceCheckpoint(playerid, 0, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand + 1][0],NextKidnapp[rand + 1][1],NextKidnapp[rand + 1][2], 5.0);
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Dynamic race checkpoints differ. Also because it'll cause run time error 4 if you use +1 index for the next x/y/z, do something like:
pawn Код:
if (sizeof (NextKidnapp) - 1 == rand) SetPlayerRaceCheckpoint(playerid, 0, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand - 1][0],NextKidnapp[rand - 1][1],NextKidnapp[rand - 1][2], 5.0);
else SetPlayerRaceCheckpoint(playerid, 0, NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand + 1][0],NextKidnapp[rand + 1][1],NextKidnapp[rand + 1][2], 5.0);
thank u its Working
i want ask u somthings
how i can make when im in this Race CP Disable it ?
Cuz i Will Add money to player and disable it
Reply
#6

I read before the word "rand", do you set random race checkpoints or you want them by order as they're in the array? Because if that's the case, we'll need to modify it.

https://sampwiki.blast.hk/wiki/OnPlayerEnterRaceCheckpoint

In the above callback, you can check if the player is in a specific race checkpoint (checking a variable you've stored before or checking if the player is in range) and then disable it with:

https://sampwiki.blast.hk/wiki/DisablePlayerRaceCheckpoint
Reply
#7

Sorry Dude
i Want Make like this
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(
FFFFFFFFFFFF(playerid))
    {
    
DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(targetid0);
    }
    return 
1;

What i Write in FFFFFFFFFF ?
i Try
PHP код:
NextKidnapp 
cuz its here
PHP код:
new Float:NextKidnapp[][3] =   /// change the next POS
{
    {
213.8458,1867.2299,13.1406},
    {
404.7588,2443.3687,16.5000},
    {
760.2078,381.6906,23.1719},
    {-
777.8541,1436.0165,13.7891}
}; 
And here
PHP код:
SetPlayerRaceCheckpoint(playerid0NextKidnapp[rand][0], NextKidnapp[rand][1], NextKidnapp[rand][2], NextKidnapp[rand 1][0],NextKidnapp[rand 1][1],NextKidnapp[rand 1][2], 5.0); 
but there error when i write NextKidnapp here
PHP код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(
NextKidnapp(playerid))
    {
    
DisablePlayerRaceCheckpoint(playerid);
    
SetPlayerHealth(targetid0);
    }
    return 
1;

see that errors
Quote:

F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(52) : error 012: invalid function call, not a valid address
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(52) : warning 215: expression has no effect
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(52) : error 001: expected token: ";", but found ")"
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(52) : error 029: invalid expression, assumed zero
F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(52) : fatal error 107: too many error messages on one line

Reply
#8

targetid? I'll comment the line because I don't know what you're doing with that.

PHP код:
new Player_NextKidnapp[MAX_PLAYERS char];
new 
Float:NextKidnapp[][3] =   /// change the next POS
{
    {
213.8458,1867.2299,13.1406},
    {
404.7588,2443.3687,16.5000},
    {
760.2078,381.6906,23.1719},
    {-
777.8541,1436.0165,13.7891}
};
// OnPlayerConnect
Player_NextKidnapp{playerid} = 255;
// wherever you want to start setting the first checkpoint:
Player_NextKidnapp{playerid} = 0;
SetPlayerRaceCheckpoint(playerid0NextKidnapp[0][0], NextKidnapp[0][1], NextKidnapp[0][2], NextKidnapp[1][0],NextKidnapp[1][1],NextKidnapp[1][2], 5.0);
// OnPlayerEnterRaceCheckpoint
if (Player_NextKidnapp{playerid} == 255) return 1;
switch (
sizeof (NextKidnapp) - Player_NextKidnapp{playerid})
{
    case 
1:
    {
        
Player_NextKidnapp{playerid} = 255;
        
        
DisablePlayerRaceCheckpoint(playerid);
        
//SetPlayerHealth(targetid, 0);
    
}
    case 
2:
    {
        new 
cp = ++Player_NextKidnapp{playerid};
        
SetPlayerRaceCheckpoint(playerid1NextKidnapp[cp][0], NextKidnapp[cp][1], NextKidnapp[cp][2], 0.00.00.05.0);
    }
    default:
    {
        new 
cp = ++Player_NextKidnapp{playerid};
        
SetPlayerRaceCheckpoint(playerid1NextKidnapp[cp][0], NextKidnapp[cp][1], NextKidnapp[cp][2], NextKidnapp[cp 1][0], NextKidnapp[cp 1][1], NextKidnapp[cp 1][2], 5.0);
    }

Reply
#9

1 errors
Quote:

F:\New Folder (2)\ffffffff\filterscripts\kidnap2.pwn(82) : error 030: compound statement not closed at the end of file (started at line 5
line 58
PHP код:
if (Player_NextKidnapp{playerid} == 255)return 1
Reply
#10

You forgot to close the brace(s). Where have you added this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)