15.05.2011, 03:51
I scripted this :
Compiles fine and all that. But doesn't lock the doors, but still sets [cLock] to 1. :S
pawn Код:
//===cmd shit up here===
else if(strcmp(x_job,"lock",true) == 0)
{
new key;
if(ForwardOwnCar(1,playerid)) { key = PlayerInfo[playerid][pCarkey]; }
else if(ForwardOwnCar(2,playerid)) { key = PlayerInfo[playerid][pCarkey2]; }
else if(ForwardOwnCar(3,playerid)) { key = PlayerInfo[playerid][pCarkey3]; }
else { return 1; }
if(CarInfo[key][cLock] == 1)
{
CarInfo[key][cLock] = 0;
GameTextForPlayer(playerid, "~w~Vehicle~n~~g~Unlocked", 4000, 3);
GetVehicleParamsEx(key,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(key,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
}
else if(CarInfo[key][cLock] == 0)
{
CarInfo[key][cLock] = 1;
GetVehicleParamsEx(key,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(key,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
GameTextForPlayer(playerid, "~w~Vehicle~n~~b~Locked", 4000, 3);
}
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
}