2 Things - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 2 Things (
/showthread.php?tid=242270)
2 Things -
Rokzlive - 19.03.2011
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?
Re: 2 Things -
Rokzlive - 19.03.2011
Plz Help
Re: 2 Things -
Serbish - 19.03.2011
2. What do you want to detect when there are 18/20 players and what should happen?
Re: 2 Things -
Rokzlive - 19.03.2011
If 18/20 players online then player can only join if vip=1 or level is above 0
Re: 2 Things -
DRIFT_HUNTER - 19.03.2011
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--;
}
Re: 2 Things -
Rokzlive - 19.03.2011
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.
Re: 2 Things -
Rokzlive - 19.03.2011
Bump
I figured out that issue, how do i do the first thing?
Re: 2 Things -
maramizo - 19.03.2011
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.
Re: 2 Things -
Rokzlive - 19.03.2011
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.
Re: 2 Things -
Rokzlive - 19.03.2011
Does anyone know how to do this?