2 Things
#1

1. How do i make it see how far the player is from 5 points, and whichever they are closest to, it sets that as their checkpoint?

2. How to i make it detect when there is 18/20 players on the server?
Reply
#2

Plz Help
Reply
#3

2. What do you want to detect when there are 18/20 players and what should happen?
Reply
#4

If 18/20 players online then player can only join if vip=1 or level is above 0
Reply
#5

Try these for reserving slots
pawn Код:
//At top of the script (under includes or somewhere there)
new ConnectedPlayers;

OnGameModeExit()
{
    ConnectedPlayers = 0;
}

OnGameModeInit()
{
    ConnectedPlayers = 0;
}

OnPlayerConnect(playerid)
{
    ConnectedPlayers++;
    if(vip == 0 && ConnectedPlayers >= 18) // Replace  vip with your variable for vip
    {
     SendClientMessage(playerid,YOUR_COLOR,"You are kicked due to slot reservation");
     kick(playerid);
    }
}

OnPlayerDisconnect(playerid,reason)
{
    ConnectedPlayers--;
}
Reply
#6

if(Vip == 0 && slots >=19)

gives me this

C:\Users\Nickolas\Desktop\PWn\Server\gamemodes\bus .pwn(1404) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#7

Bump

I figured out that issue, how do i do the first thing?
Reply
#8

Figure out an equation to relate X,Y,Z of player and all 5 checkpoints, find an average and find which one is smallest difference.
Reply
#9

I wanted to use GetPlayerDistanceToPoint(playerid,x,y,z); fora all 5 points but i dont know what value it returns to show distance nor how to make it choose the shortest one.
Reply
#10

Does anyone know how to do this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)