Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/buyvehicle", cmdtext, true, 10) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 10.0, 919.4584,-1252.2156,16.2109))
- {
- ShowPlayerDialog(playerid,DIALOG_CATEGORY,DIALOG_STYLE_LIST ,"1. Choose a category","Aircrafts\nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nSaloons\nSport Vehicles\nStation Wagons\nBoats\nUnique Vehicles","Next","Cancel");
- return 1;
- } else { SendClientMessage(playerid, COLOR_GREY, "Error: {FFFFFF}You are not at the vehicle dealership."); return 1; } // It will return that message if the player isn't at the dealership
- }
- if(strcmp("/vehiclecommands", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, COLOR_GREEN, "________________Vehicle commands:_________________");
- SendClientMessage(playerid, COLOR_GRAD6, "/lock /locateveh /towveh /park /setcolor /setplate");
- SendClientMessage(playerid, COLOR_GREEN, "__________________________________________________");
- }
- if(strcmp("/setplate", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to change the plate to."); return 1; }
- if(GetPlayerMoney(playerid) < 1000) { SendClientMessage(playerid, COLOR_WHITE, "You need at least $5,000 to change your vehicle plate."); return 1; }
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setplate [1-2-3] [carplate]"); return 1; }
- if(strcmp(x_nr,"1",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] != 0)
- {
- new vehid;
- if(GetPlayerVehicleID(playerid) == personalcar1[playerid]) { vehid = personalcar1[playerid]; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat inside your vehicle."); return 1; }
- if(IsPlayerInVehicle(playerid, vehid))
- {
- if(!cmdtext[idx]) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setplate 1 [carplate]"); }
- new Float:XX,Float:YY,Float:ZZ,Float:AA;
- new Float:CarHP, Float:OldCarHP;
- new panels,tires;
- GetVehicleHealth(vehid, CarHP);
- GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
- OldCarHP = CarHP;
- format(PlayerInfo[playerid][pVehicle1Plate], 32 ,"%s",cmdtext[idx]);
- SetVehicleNumberPlate(vehid,PlayerInfo[playerid][pVehicle1Plate]);
- GetVehiclePos(vehid,XX,YY,ZZ);
- GetVehicleZAngle(vehid, AA);
- SetVehicleToRespawn(vehid);
- SetVehiclePos(vehid,XX,YY,ZZ);
- SetVehicleZAngle(vehid, AA);
- PutPlayerInVehicle(playerid,vehid,0);
- SetVehicleHealth(vehid, OldCarHP);
- UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
- format(string, sizeof(string), "You have set your first vehicle's plate to %s, it costed $5,000", PlayerInfo[playerid][pVehicle1Plate]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GivePlayerMoney(playerid, -5000);
- ChangeVehicleColor(vehid, PlayerInfo[playerid][pVehicle1Color1], PlayerInfo[playerid][pVehicle1Color2]);
- OnPlayerUpdateEx(playerid);
- }
- else { format(string, sizeof(string), "You are not in your first vehicle."); SendClientMessage(playerid, COLOR_WHITE, string); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 1."); return 1; }
- }
- else if(strcmp(x_nr,"2",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle2] != 0)
- {
- new vehid;
- if(GetPlayerVehicleID(playerid) == personalcar2[playerid]) { vehid = personalcar2[playerid]; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat inside your vehicle."); return 1; }
- if(IsPlayerInVehicle(playerid, vehid))
- {
- if(!cmdtext[idx]) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setplate 2 [carplate]"); }
- new Float:XX,Float:YY,Float:ZZ,Float:AA;
- new Float:CarHP, Float:OldCarHP;
- new panels,tires;
- GetVehicleHealth(vehid, CarHP);
- GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
- OldCarHP = CarHP;
- format(PlayerInfo[playerid][pVehicle2Plate], 32 ,"%s",cmdtext[idx]);
- SetVehicleNumberPlate(vehid,PlayerInfo[playerid][pVehicle2Plate]);
- GetVehiclePos(vehid,XX,YY,ZZ);
- GetVehicleZAngle(vehid, AA);
- SetVehicleToRespawn(vehid);
- SetVehiclePos(vehid,XX,YY,ZZ);
- SetVehicleZAngle(vehid, AA);
- PutPlayerInVehicle(playerid,vehid,0);
- SetVehicleHealth(vehid, OldCarHP);
- UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
- format(string, sizeof(string), "You have set your second vehicle's plate to %s, it costed $5,000", PlayerInfo[playerid][pVehicle2Plate]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GivePlayerMoney(playerid, -5000);
- ChangeVehicleColor(vehid, PlayerInfo[playerid][pVehicle2Color1], PlayerInfo[playerid][pVehicle2Color2]);
- OnPlayerUpdateEx(playerid);
- }
- else { format(string, sizeof(string), "You are not in your second vehicle."); SendClientMessage(playerid, COLOR_WHITE, string); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 2."); return 1; }
- }
- else if(strcmp(x_nr,"3",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle3] != 0)
- {
- new vehid;
- if(GetPlayerVehicleID(playerid) == personalcar3[playerid]) { vehid = personalcar3[playerid]; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat inside your vehicle."); return 1; }
- if(IsPlayerInVehicle(playerid, vehid))
- {
- if(!cmdtext[idx]) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setplate 3 [carplate]"); }
- new Float:XX,Float:YY,Float:ZZ,Float:AA;
- new Float:CarHP, Float:OldCarHP;
- new panels,tires;
- GetVehicleHealth(vehid, CarHP);
- GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
- OldCarHP = CarHP;
- format(PlayerInfo[playerid][pVehicle3Plate], 32 ,"%s",cmdtext[idx]);
- SetVehicleNumberPlate(vehid,PlayerInfo[playerid][pVehicle3Plate]);
- GetVehiclePos(vehid,XX,YY,ZZ);
- GetVehicleZAngle(vehid, AA);
- SetVehicleToRespawn(vehid);
- SetVehiclePos(vehid,XX,YY,ZZ);
- SetVehicleZAngle(vehid, AA);
- PutPlayerInVehicle(playerid,vehid,0);
- SetVehicleHealth(vehid, OldCarHP);
- UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
- format(string, sizeof(string), "You have set your third vehicle's plate to %s, it costed $5,000", PlayerInfo[playerid][pVehicle3Plate]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- GivePlayerMoney(playerid, -5000);
- ChangeVehicleColor(vehid, PlayerInfo[playerid][pVehicle3Color1], PlayerInfo[playerid][pVehicle3Color2]);
- OnPlayerUpdateEx(playerid);
- }
- else { format(string, sizeof(string), "You are not in your third vehicle."); SendClientMessage(playerid, COLOR_WHITE, string); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 3."); return 1; }
- }
- return 1;
- }
- if(strcmp("/locateveh", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to locate."); return 1; }
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/locateveh [1-2-3]"); return 1; }
- if(strcmp(x_nr,"1",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] != 0)
- {
- CP[playerid] = 69;
- new Float:vehx, Float:vehy, Float:vehz; GetVehiclePos(personalcar1[playerid], vehx, vehy, vehz);
- SetPlayerCheckpoint(playerid, vehx, vehy, vehz, 6.0);
- SendClientMessage(playerid, COLOR_WHITE, "A checkpoint has been set to your vehicle in slot 1.");
- return 1;
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 1."); return 1; }
- }
- else if(strcmp(x_nr,"2",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle2] != 0)
- {
- CP[playerid] = 69;
- new Float:vehx, Float:vehy, Float:vehz; GetVehiclePos(personalcar2[playerid], vehx, vehy, vehz);
- SetPlayerCheckpoint(playerid, vehx, vehy, vehz, 6.0);
- SendClientMessage(playerid, COLOR_WHITE, "A checkpoint has been set to your vehicle in slot 2.");
- return 1;
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 2."); return 1; }
- }
- else if(strcmp(x_nr,"3",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle3] != 0)
- {
- CP[playerid] = 69;
- new Float:vehx, Float:vehy, Float:vehz; GetVehiclePos(personalcar3[playerid], vehx, vehy, vehz);
- SetPlayerCheckpoint(playerid, vehx, vehy, vehz, 6.0);
- SendClientMessage(playerid, COLOR_WHITE, "A checkpoint has been set to your vehicle in slot 3.");
- return 1;
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 3."); return 1; }
- }
- return 1;
- }
- if(strcmp("/vehtow", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to tow."); return 1; }
- if(GetPlayerMoney(playerid) < 1000) { SendClientMessage(playerid, COLOR_WHITE, "You need at least $1,000 to tow a vehicle."); return 1; }
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/towveh [1-2-3]"); return 1; }
- if(strcmp(x_nr,"1",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] != 0)
- {
- new car = personalcar1[playerid];
- if(CarTow(car)) { SendClientMessage(playerid, COLOR_WHITE, "You towed your vehicle in slot 1 to its last /park position, it costed you $1,000.");
- GivePlayerMoney(playerid, -1000); SetVehiclePos(car, PlayerInfo[playerid][pVehicle1X], PlayerInfo[playerid][pVehicle1Y], PlayerInfo[playerid][pVehicle1Z]);
- SetVehicleZAngle(car, PlayerInfo[playerid][pVehicle1C]); }
- else { SendClientMessage(playerid, COLOR_WHITE, "You can't tow the vehicle because it's in use."); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 1."); return 1; }
- }
- else if(strcmp(x_nr,"2",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle2] != 0)
- {
- new car = personalcar2[playerid];
- if(CarTow(car)) { SendClientMessage(playerid, COLOR_WHITE, "You towed your vehicle in slot 2 to its last /park position, it costed you $1,000.");
- GivePlayerMoney(playerid, -1000); SetVehiclePos(car, PlayerInfo[playerid][pVehicle2X], PlayerInfo[playerid][pVehicle2Y], PlayerInfo[playerid][pVehicle2Z]);
- SetVehicleZAngle(car, PlayerInfo[playerid][pVehicle2C]); }
- else { SendClientMessage(playerid, COLOR_WHITE, "You can't tow the vehicle because it's in use."); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 2."); return 1; }
- }
- else if(strcmp(x_nr,"3",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle3] != 0)
- {
- new car = personalcar3[playerid];
- if(CarTow(car)) { SendClientMessage(playerid, COLOR_WHITE, "You towed your vehicle in slot 3 to its last /park position, it costed you $1,000.");
- GivePlayerMoney(playerid, -1000); SetVehiclePos(car, PlayerInfo[playerid][pVehicle3X], PlayerInfo[playerid][pVehicle3Y], PlayerInfo[playerid][pVehicle3Z]);
- SetVehicleZAngle(car, PlayerInfo[playerid][pVehicle3C]); }
- else { SendClientMessage(playerid, COLOR_WHITE, "You can't tow the vehicle because it's in use."); return 1; }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 3."); return 1; }
- }
- return 1;
- }
- if(strcmp("/setcolor", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to change the color of."); return 1; }
- if(GetPlayerMoney(playerid) < 500) { SendClientMessage(playerid, COLOR_WHITE, "You need at least $500 to change your vehicle's color."); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setcolor [color1] [color2]"); return 1; }
- new color1;
- color1 = strval(tmp);
- if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, "The first color cannot be below 0 or above 126."); return 1; }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/setcolor [color1] [color2]"); return 1; }
- new color2;
- color2 = strval(tmp);
- if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, "The second color cannot be below 0 or above 126."); return 1; }
- new vehid, vehid2, vehid3;
- if(GetPlayerVehicleID(playerid) == personalcar1[playerid]) { vehid = personalcar1[playerid]; }
- else if(GetPlayerVehicleID(playerid) == personalcar2[playerid]) { vehid2 = personalcar2[playerid]; }
- else if(GetPlayerVehicleID(playerid) == personalcar3[playerid]) { vehid3 = personalcar3[playerid]; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat inside your vehicle."); return 1; }
- if(IsPlayerInVehicle(playerid, vehid)) { PlayerInfo[playerid][pVehicle1Color1] = color1; PlayerInfo[playerid][pVehicle1Color2] = color2;
- GivePlayerMoney(playerid, -500); format(string, sizeof(string), "You changed this car to color %d and %d.", color1, color2);
- SendClientMessage(playerid, COLOR_WHITE, string); ChangeVehicleColor(vehid, color1, color2); OnPlayerUpdateEx(playerid); return 1; }
- else if(IsPlayerInVehicle(playerid, vehid2)) { PlayerInfo[playerid][pVehicle2Color1] = color1; PlayerInfo[playerid][pVehicle2Color2] = color2;
- GivePlayerMoney(playerid, -500); format(string, sizeof(string), "You changed this car to color %d and %d.", color1, color2);
- SendClientMessage(playerid, COLOR_WHITE, string); ChangeVehicleColor(vehid2, color1, color2); OnPlayerUpdateEx(playerid); return 1; }
- else if(IsPlayerInVehicle(playerid, vehid3)) { PlayerInfo[playerid][pVehicle3Color1] = color1; PlayerInfo[playerid][pVehicle3Color2] = color2;
- GivePlayerMoney(playerid, -500); format(string, sizeof(string), "You changed this car to color %d and %d.", color1, color2);
- SendClientMessage(playerid, COLOR_WHITE, string); ChangeVehicleColor(vehid3, color1, color2); OnPlayerUpdateEx(playerid); return 1; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat in your vehicle to use this command."); return 1; }
- }
- if(strcmp("/lock", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to lock or unlock."); return 1; }
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_GREY, "Syntax: {FFFFFF}/lock [1-2-3]"); return 1; }
- if(strcmp(x_nr,"1",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] != 0)
- {
- if(PlayerInfo[playerid][pVehicle1Lock] == 0)
- {
- GetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle1Lock] = 1;
- GameTextForPlayer(playerid, "~w~vehicle 1~r~ LOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- else if(PlayerInfo[playerid][pVehicle1Lock] != 0)
- {
- GetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar1[playerid], engine, lights, alarm, 0, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle1Lock] = 0;
- GameTextForPlayer(playerid, "~w~vehicle 1~g~ UNLOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 1."); return 1; }
- }
- else if(strcmp(x_nr,"2",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle2] != 0)
- {
- if(PlayerInfo[playerid][pVehicle2Lock] == 0)
- {
- GetVehicleParamsEx(personalcar2[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar2[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle2Lock] = 1;
- GameTextForPlayer(playerid, "~w~vehicle 2~r~ LOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- else if(PlayerInfo[playerid][pVehicle2Lock] != 0)
- {
- GetVehicleParamsEx(personalcar2[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar2[playerid], engine, lights, alarm, 0, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle2Lock] = 0;
- GameTextForPlayer(playerid, "~w~vehicle 2~g~ UNLOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 2."); return 1; }
- }
- else if(strcmp(x_nr,"3",true) == 0)
- {
- if(PlayerInfo[playerid][pVehicle3] != 0)
- {
- if(PlayerInfo[playerid][pVehicle3Lock] == 0)
- {
- GetVehicleParamsEx(personalcar3[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar3[playerid], engine, lights, alarm, 1, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle3Lock] = 1;
- GameTextForPlayer(playerid, "~w~vehicle 3~r~ LOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- else if(PlayerInfo[playerid][pVehicle3Lock] != 0)
- {
- GetVehicleParamsEx(personalcar3[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
- SetVehicleParamsEx(personalcar3[playerid], engine, lights, alarm, 0, bonnet, boot, objective);
- PlayerInfo[playerid][pVehicle3Lock] = 0;
- GameTextForPlayer(playerid, "~w~vehicle 3~g~ UNLOCKED", 3000, 6);
- OnPlayerUpdateEx(playerid);
- return 1;
- }
- } else { SendClientMessage(playerid, COLOR_WHITE, "You don't have a vehicle on slot 3."); return 1; }
- }
- return 1;
- }
- if(strcmp("/park", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pVehicle1] == 0 && PlayerInfo[playerid][pVehicle2] == 0 && PlayerInfo[playerid][pVehicle3] == 0)
- { SendClientMessage(playerid, COLOR_WHITE, "You do not own any vehicles to park."); return 1; }
- new vehid, vehid2, vehid3;
- if(GetPlayerVehicleID(playerid) == personalcar1[playerid]) { vehid = personalcar1[playerid]; }
- else if(GetPlayerVehicleID(playerid) == personalcar2[playerid]) { vehid2 = personalcar2[playerid]; }
- else if(GetPlayerVehicleID(playerid) == personalcar3[playerid]) { vehid3 = personalcar3[playerid]; }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat in your vehicle to use this command."); return 1; }
- if(IsPlayerInVehicle(playerid, vehid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new Float:x,Float:y,Float:z,Float:a;
- GetVehiclePos(vehid, x, y, z);
- GetVehicleZAngle(vehid, a);
- PlayerInfo[playerid][pVehicle1X] = x;
- PlayerInfo[playerid][pVehicle1Y] = y;
- PlayerInfo[playerid][pVehicle1Z] = z;
- PlayerInfo[playerid][pVehicle1C] = a;
- OnPlayerUpdateEx(playerid);
- DestroyVehicle(personalcar1[playerid]);
- new model1 = PlayerInfo[playerid][pVehicle1Model];
- new car1color1 = PlayerInfo[playerid][pVehicle1Color1];
- new car1color2 = PlayerInfo[playerid][pVehicle1Color2];
- personalcar1[playerid] = CreateVehicle(model1, Float:x, Float:y, Float:z, Float:a, car1color1, car1color2, 999999);
- SetVehicleNumberPlate(personalcar1[playerid], PlayerInfo[playerid][pVehicle1Plate]);
- TogglePlayerControllable(playerid, 1);
- PutPlayerInVehicle(playerid, vehid, 0);
- SendClientMessage(playerid, COLOR_WHITE, "You parked your car here, it will respawn at this position.");
- return 1;
- }
- else if(IsPlayerInVehicle(playerid, vehid2) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new Float:x,Float:y,Float:z,Float:a;
- GetVehiclePos(vehid2, x, y, z);
- GetVehicleZAngle(vehid2, a);
- PlayerInfo[playerid][pVehicle2X] = x;
- PlayerInfo[playerid][pVehicle2Y] = y;
- PlayerInfo[playerid][pVehicle2Z] = z;
- PlayerInfo[playerid][pVehicle2C] = a;
- OnPlayerUpdateEx(playerid);
- DestroyVehicle(personalcar2[playerid]);
- new model2 = PlayerInfo[playerid][pVehicle2Model];
- new car2color1 = PlayerInfo[playerid][pVehicle2Color1];
- new car2color2 = PlayerInfo[playerid][pVehicle2Color2];
- personalcar2[playerid] = CreateVehicle(model2, Float:x, Float:y, Float:z, Float:a, car2color1, car2color2, 999999);
- SetVehicleNumberPlate(personalcar2[playerid], PlayerInfo[playerid][pVehicle2Plate]);
- TogglePlayerControllable(playerid, 1);
- PutPlayerInVehicle(playerid, vehid2, 0);
- SendClientMessage(playerid, COLOR_WHITE, "You parked your car here, it will respawn at this position.");
- return 1;
- }
- else if(IsPlayerInVehicle(playerid, vehid3) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new Float:x,Float:y,Float:z,Float:a;
- GetVehiclePos(vehid3, x, y, z);
- GetVehicleZAngle(vehid3, a);
- PlayerInfo[playerid][pVehicle3X] = x;
- PlayerInfo[playerid][pVehicle3Y] = y;
- PlayerInfo[playerid][pVehicle3Z] = z;
- PlayerInfo[playerid][pVehicle3C] = a;
- OnPlayerUpdateEx(playerid);
- DestroyVehicle(personalcar3[playerid]);
- new model3 = PlayerInfo[playerid][pVehicle3Model];
- new car3color1 = PlayerInfo[playerid][pVehicle3Color1];
- new car3color2 = PlayerInfo[playerid][pVehicle3Color2];
- personalcar3[playerid] = CreateVehicle(model3, Float:x, Float:y, Float:z, Float:a, car3color1, car3color2, 999999);
- SetVehicleNumberPlate(personalcar3[playerid], PlayerInfo[playerid][pVehicle3Plate]);
- TogglePlayerControllable(playerid, 1);
- PutPlayerInVehicle(playerid, vehid3, 0);
- SendClientMessage(playerid, COLOR_WHITE, "You parked your car here, it will respawn at this position.");
- return 1;
- }
- else { SendClientMessage(playerid, COLOR_WHITE, "You need to be sat in your vehicle to use this command."); return 1; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement