Whats wrong with this /enter - 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)
+--- Thread: Whats wrong with this /enter (
/showthread.php?tid=324058)
Whats wrong with this /enter -
ShawnMiller1337 - 07.03.2012
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 ?
Re: Whats wrong with this /enter -
Gerira Gaijin - 07.03.2012
Player is not in a vehicle. Make a loop that goes through all the cars and checks if the player is near Shamal.
Re: Whats wrong with this /enter -
2KY - 07.03.2012
I'm assuming that the following line is incorrect. Post how you get closestcar.
pawn Код:
if(IsPlayerInRangeOfVehicle(playerid, closestcar, 5.0)
AW: Whats wrong with this /enter -
Drebin - 07.03.2012
Shouldn't
pawn Код:
if(VehicleStatus{vehicleid} == 1)
be
pawn Код:
if(VehicleStatus[vehicleid] == 1)
Re: AW: Whats wrong with this /enter -
2KY - 07.03.2012
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.
Re: Whats wrong with this /enter -
ShawnMiller1337 - 08.03.2012
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);