23.01.2014, 18:16
I'm having trouble trying to get this function to work when the player is outside the vehicle trying to put the garbage bag in the back of the garbage truck. Any ideas?
pawn Код:
if((newkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
new string[256];
new Float:cx, Float:cy, Float:cz;
GetVehiclePos(oldcar1[playerid], cx, cy, cz);
if(IsPlayerInRangeOfPoint(playerid, 3, cx, cy, cz) && GetVehicleModel(oldcar1[playerid]) == 408)
{
if(PlayerInfo[playerid][pJob] == 7 && HoldingObject[playerid] == 2)
{
RemovePlayerAttachedObject(playerid, 0);
HoldingObject[playerid] = 0;
format(string, sizeof(string), " %s places the trash bag into the back of the garbage truck", GetPName(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}