Whats wrong with this /enter
#1

pawn Код:
else if(IsPlayerInRangeOfVehicle(playerid, closestcar, 5.0) && GetVehicleModel(GetPlayerVehicleID(playerid) == 519))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if(VehicleStatus{vehicleid} == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "You are not allowed to enter this Shamal as it's been damaged!");
        new string[47 + MAX_PLAYER_NAME];
        format(string, sizeof(string), "* %s enters the Shamal airplane as a passenger.", GetPlayerNameEx(playerid));
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        SetPlayerPos(playerid, 2.509036, 23.118730, 1199.593750);
        SetPlayerFacingAngle(playerid, 82.14);
        SetCameraBehindPlayer(playerid);
        PlayerInfo[playerid][pVW] = vehicleid;
        SetPlayerVirtualWorld(playerid, vehicleid);
        PlayerInfo[playerid][pInt] = 1;
        SetPlayerInterior(playerid, 1);
        InsideShamal[playerid] = vehicleid;
        SendClientMessageEx(playerid, COLOR_WHITE, "Type /exit near the door to exit the vehicle, or /window to look outside.");
    }
It compiles fine with no errors but when I do /enter near a shamal nothng happens ?
Reply
#2

Player is not in a vehicle. Make a loop that goes through all the cars and checks if the player is near Shamal.
Reply
#3

I'm assuming that the following line is incorrect. Post how you get closestcar.

pawn Код:
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 5.0)
Reply
#4

Shouldn't
pawn Код:
if(VehicleStatus{vehicleid} == 1)
be
pawn Код:
if(VehicleStatus[vehicleid] == 1)
Reply
#5

Quote:
Originally Posted by Drebin
Посмотреть сообщение
Shouldn't
pawn Код:
VehicleStatus{vehicleid} == 1
be
pawn Код:
VehicleStatus[vehicleid] == 1
Not if he has it defined as

pawn Код:
new VehicleStatus[MAX_VEHICLES char];
Although, that only allows up to 255 vehicles.
Reply
#6

Quote:
Originally Posted by Gerira Gaijin
Посмотреть сообщение
Player is not in a vehicle. Make a loop that goes through all the cars and checks if the player is near Shamal.
pawn Код:
else if(IsPlayerInRangeOfVehicle(playerid, closestcar, 5.0) && GetVehicleModel(GetPlayerVehicleID(playerid) == 519))

I'm trying to make it so if a player is within 5.0 of the closest shamal and double checking its a shamal as you see.. This command is suppose to be on /enter

and cloestcar is defined by new closestcar = GetClosestCar(playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)