11.09.2011, 16:20
Hello scripter. So i have a /mycar command, with puts you in your locked vehicle, and i have a export system.
What i was trying to do was, so that if a players locked car is exportable, then u can't use the command /mycar....
It's all based on PVars. Let me show you.
MYCAR command:
Now here's the part where export system saves the PVar's:
This is a 1sec timer....
When i'm in a exportable vehicle and i type /mycar, it doesnt show the error message, it just puts me itn to the exportable car.
Help would be very epriciated.
What i was trying to do was, so that if a players locked car is exportable, then u can't use the command /mycar....
It's all based on PVars. Let me show you.
MYCAR command:
Код:
dcmd_mycar(playerid,params[]) { #pragma unused params new veh[MAX_PLAYERS]; veh[playerid] = GetPlayerVehicleID(playerid); new ExportCarID1[MAX_PLAYERS]; new ExportCarID2[MAX_PLAYERS]; new ExportCarID3[MAX_PLAYERS]; new LockedCarModel[MAX_PLAYERS]; LockedCarModel[playerid] = GetVehicleModel(LockedCar[playerid]); ExportCarID1[playerid] = GetPVarInt(playerid,"ExportCar1"); ExportCarID2[playerid] = GetPVarInt(playerid,"ExportCar2"); ExportCarID3[playerid] = GetPVarInt(playerid,"ExportCar3"); new Float:X,Float:Y,Float:Z,Float:Angle,interior; if(GetPlayerScore(playerid) < 3) return SendClientMessage(playerid, GREY, "ERROR: You need 3rd level."); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, GREY, "ERROR: You have to be on foot to use this."); if(LockedCar[playerid] == ExportCarID1[playerid] || LockedCar[playerid] == ExportCarID2[playerid] || LockedCar[playerid] == ExportCarID3[playerid]) return SendClientMessage(playerid, GREY, "ERROR: your locked car is on the export list, so u can't use this!"); if(HasACarLocked[playerid] == 0) return SendClientMessage(playerid, GREY, "ERROR: You havent locked any car!"); GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); interior = GetPlayerInterior(playerid); SetVehiclePos(LockedCar[playerid], X,Y,Z); LinkVehicleToInterior(LockedCar[playerid],interior); SetVehicleZAngle(LockedCar[playerid],Angle); PutPlayerInVehicle(playerid, LockedCar[playerid], 0); return 1; }
This is a 1sec timer....
Код:
public ScanVehicleStatus() { for (new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerInAnyVehicle(i)) { new carmodel = GetVehicleModel(GetPlayerVehicleID(i)); if (carmodel == carselect[0] || carmodel == carselect[1] || carmodel == carselect[2]) { MiniMission[i] = CHECKPOINT_EXPORT; } } } for (new i = 0; i < MAX_PLAYERS; i++) { SetPVarInt(i,"ExportCar1",carselect[0]); SetPVarInt(i,"ExportCar2",carselect[1]); SetPVarInt(i,"ExportCar3",carselect[2]); } return 1; }
Help would be very epriciated.