Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
Hi, i have a problem.
Only one person can join my minigame only. How can i do this? my only idea is a pawno code that checks to see if the car is in use, if it is the player can't join. and if the car is not being used, the player can join.
Is this possible?
Thanks!
Posts: 686
Threads: 29
Joined: Feb 2011
Reputation:
0
I.
Have no idea what the fuck you're talkin about.
Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
lol. I need a command that will allow a player to enter a vehicle from a command if the vehicle is not in-use
Posts: 1,506
Threads: 69
Joined: Feb 2008
I just made this, yes it's been made before but w/e.
Put this anywhere in ur script, not inside a callback.
pawn Код:
stock IsVehicleOccupied(vehicleid) // Returns 1 if there is anyone in the vehicle
{
foreach(Player,i)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i)==vehicleid)
{
return 1;
}
else
{
return 0;
}
}
}
}
USAGE: IsVehicleOccupied(vehicleid)
EXAMPLE:
pawn Код:
if(IsVehicleOccupied(100)) // Change 100 to the vehicleid you need to check
{
SendClientMessage(playerid,-1,"Sorry, you cannot enter the minigame at this time.");
}
else
{
SendClientMessage(playerid,-1,"Welcome to the minigame!");
}
You need to include this;
https://sampforum.blast.hk/showthread.php?tid=92679
Posts: 1,506
Threads: 69
Joined: Feb 2008
Did you define a number or vehicle to "monster" ?
I don't get any errors though.
Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
Fantastic! That is what i forgot to do lol. Fixed. Thank you very much