How to make to player can enter in checkpoint only if he is in veh id 411 ?
#1

How to do that ?And i want if tha player is in another veh or on foot, server send message"You arent in your car, you cant enter"
Reply
#2

Use https://sampwiki.blast.hk/wiki/IsPlayerInAnyVehicle, this will check if the player is in a vehicle, and if so, then you can use this to check his vehicle ID: https://sampwiki.blast.hk/wiki/GetPlayerVehicleID. You can use them both to check if the player is in a vehicle ID of 411, as you wanted in the title.
Reply
#3

And how to server send him a message "you are not in veh id 411"And how to server block my command if the player isnt in that veh ?
Reply
#4

If you create code for player if he is in vehicle id 411 then he will able to use it, then u don't need to block it cause it will not allow players to use ur function if he isn't in vehicle id 411 as a error you can use SendClientMessage(playerid, color, "your error message here");
Reply
#5

Код:
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
	{
		if(ArrivedAtCheckPoint[playerid] == 1)
		{
                      //SCRIPT YOUR SHIT
                }
                else return SendClientMessage(playerid, color, "You are not at the Checkpoint yet");
        }
        else return SendClientMessage(playerid, color, "This is not the right vehicle to enter the checkpoint");
}
Reply
#6

Ex: Your name bustern

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(vehicleid == 411)
    {
        new pname[50];
        if(GetPlayerName(playerid,pname,sizeof(pname) == strval("bustern")))
        {
            SendClientMessage(playerid,-1,"Welcome to Infernus");
        }
        else
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid,-1,"You't don't have access to use this vehicle");
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by Lynchos
Посмотреть сообщение
Код:
{
	if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
	{
		if(ArrivedAtCheckPoint[playerid] == 1)
		{
                      //SCRIPT YOUR SHIT
                }
                else return SendClientMessage(playerid, color, "You are not at the Checkpoint yet");
        }
        else return SendClientMessage(playerid, color, "This is not the right vehicle to enter the checkpoint");
}
doesnt work
Reply
#8

Nevermind, i scrripted it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)