Making a /megaphone command
#1

How do I make it so a player has to be in a certain vehicle for a command to work? Please HELP
Reply
#2

pawn Код:
if(IsPlayerInVehicle(playerid,/*Here you put the vehicle ID*/))return SendClientMessage(playerid,RED,"You Need to be in a certain vehicle for this to work!");
Reply
#3

Quote:
Originally Posted by -The_Badger-
pawn Код:
if(IsPlayerInVehicle(playerid,/*Here you put the vehicle ID*/))return SendClientMessage(playerid,RED,"You Need to be in a certain vehicle for this to work!");
1 more question... if you wanted to remove a player from a vehicle when they enter a certain car, how do you do it? I put IsPlayerInVehicle under OnPlayerEnterVehicle but it doesnt work when I go try it
Reply
#4

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float:X,Float:Y, Float:Z;
    GetPlayerPos(playerid,X,Y,Z);

    if(IsPlayerInVehicle(playerid,/*the vehicle*/)){
        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid, 0, 1);
        SetPlayerPos(playerid,X,Y,Z);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)