if (newkeys & KEY_NO) { if(SwitchKey[playerid] == 1) { new string[100]; for(new v=0; v<MAX_PVEHS; v++) { if(CheckPlayerDistanceToVehicle(3.0, playerid, personalcar[v][playerid])) { if(CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 1) { GetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,0,bonnet,boot,objective); format(string, sizeof(string), "~h~%s~n~~g~Unlocked",CarInfo[OwnedVeh(personalcar[v][playerid])][cDescription]); GameTextForPlayer(playerid, string, 4000, 4); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] = 0; SetVehicleParamsForPlayer(personalcar[v][playerid],playerid,0,0); gCarLock[personalcar[v][playerid]] = 0; vUpdate(OwnedVeh(personalcar[v][playerid]), cLockx); // return 1; } else if(CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 0) { GetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,1,bonnet,boot,objective); format(string, sizeof(string), "~h~%s~n~~r~Locked",CarInfo[OwnedVeh(personalcar[v][playerid])][cDescription]); GameTextForPlayer(playerid, string, 4000, 4); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); SetVehicleParamsForPlayer(personalcar[v][playerid],playerid,0,0); CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] = 1; gCarLock[personalcar[v][playerid]] = 1; vUpdate(OwnedVeh(personalcar[v][playerid]), cLockx); // return 1; } } } return 1; }
new engine ,lights ,alarm ,bonnet ,boot ,objective; for(new v=0; v<MAX_PVEHS; v++) { if(OwnedVeh(personalcar[v][playerid])) { if(personalcar[v][playerid] != 0 && CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 1) { SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,0,bonnet,boot,objective);//AICI AM RAMAS } else if(PlayerInfo[playerid][pPcarkey] == 0 && PlayerInfo[playerid][pmotokey] == 0 && PlayerInfo[playerid][phelikey] == 0 && PlayerInfo[playerid][pprcarkey] == 0 && PlayerInfo[playerid][pprcarkey2] == 0 && PlayerInfo[playerid][pPPluscarkey] == 0 && PlayerInfo[playerid][pPPluscarkey2] == 0 && PlayerInfo[playerid][pPPluscarkey3] == 0 && PlayerInfo[playerid][pPPluscarkey4] == 0 && PlayerInfo[playerid][pPPluscarkey5] == 0 && PlayerInfo[playerid][pPPluscarkey6] == 0) { if(personalcar[v][playerid] != 0 && CarInfo[OwnedVeh(personalcar[v][playerid])][cLock] == 1) { SetVehicleParamsEx(personalcar[v][playerid],engine,lights,alarm,1,bonnet,boot,objective); } } } }
for(new v=0; v<MAX_PVEHS; v++) |
for(new v, vv = GetVehiclePoolSize(); v <= vv; v++) |