22.06.2013, 17:44
How can i make it where if im around a car i can use /cartrunk instead of being inside of the car?
CMD:
CMD:
pawn Код:
CMD:cartrunk(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
new string[128];
new pname[MAX_PLAYER_NAME];
if(Boot[vehicle] == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s Has opened his/her's vehicle's trunk", pname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_WHITE, "You have vehicle's trunk to {00FF00}[OPEN]");
Boot[vehicle] = 1;
SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, 1, objective);
}
else if(Boot[vehicle] == 1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
Boot[vehicle] = 0;
SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, 0, objective);
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s Has pulled down his/her's vehicle's trunk", pname);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_WHITE, "You have vehicle's trunk to {FF0000}[CLOSED]");
}
}
return 1;
}