Quote:
Originally Posted by мυ∂υℓ_вacнα
you should add this at the top of your script !!!!
pawn Код:
new vehicleid [ MAX_PLAYERS ];
pawn Код:
new vehicleid [ MAX_PLAYERS ];
command:(lock, playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You must be in a vehicle to use this command!");
new VehicleID = GetPlayerVehicleID(playerid); if(OwnedCar(VehicleID) != 0) { if(strmatch(Vehicles[OwnedCar(VehicleID)][VehicleOwner], pName(playerid))) { Vehicles[OwnedCar(VehicleID)][vLocked] = 1; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective); SendClientMessage(playerid, -1, "You've successfully locked your vehicle!"); SaveOwnedCar(OwnedCar(VehicleID)); return 1; } else return SendClientMessage(playerid, RED, "This vehicle does not belong to you!"); } else return SendClientMessage(playerid, RED, "This is not a private vehicle!"); }
TRy now with this !!!
|
Oh my god,, so much fail. Don't ever try to fix your code like the way above, it will never work.
Luke: use the force! Seriously though, every variable is used differently. If you still can't tell global variables from local variables, then please refresh your coding course (also, PAWN is case sensitive as being told, that shouldve been enough of a hint).