11.12.2014, 17:11
it is my /park command(man az ro in bardashtam)
Код:
if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pBVeh]) return SendClientMessage(playerid, COLOR_GREY, "Shoma Nistid Dar vehicle you can park."); SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your vehicle, it will always spawn here until you park it somewhere else."); if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh]) { for(new i=0; i<14; i++) { PlayerInfo[playerid][pVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVeh], i); } topened[playerid] = 0; GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]); GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]); DestroyVehicle(PlayerInfo[playerid][pVeh]); PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],32000); SetVehicleVirtualWorld(PlayerInfo[playerid][pVeh], GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(PlayerInfo[playerid][pVeh], GetPlayerInterior(playerid)); ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]); for(new i=0; i<14; i++) { AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]); } } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh]) { for(new i=0; i<14; i++) { PlayerInfo[playerid][pVVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVVeh], i); } GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]); GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]); DestroyVehicle(PlayerInfo[playerid][pVVeh]); PlayerInfo[playerid][pVVeh] = CreateVehicle(PlayerInfo[playerid][vVModel], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ],PlayerInfo[playerid][vVA],PlayerInfo[playerid][vVC1],PlayerInfo[playerid][vVC2],32000); SetVehicleVirtualWorld(PlayerInfo[playerid][pVVeh], GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(PlayerInfo[playerid][pVVeh], GetPlayerInterior(playerid)); ChangeVehiclePaintjob(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVPJ]); for(new i=0; i<14; i++) { AddVehicleComponent(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVehMod][i]); } } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pBVeh]) { for(new i=0; i<14; i++) { PlayerInfo[playerid][pBVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pBVeh], i); } GetVehiclePos(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ]); GetVehicleZAngle(PlayerInfo[playerid][pBVeh],PlayerInfo[playerid][vBA]); DestroyVehicle(PlayerInfo[playerid][pBVeh]); PlayerInfo[playerid][pBVeh] = CreateVehicle(PlayerInfo[playerid][vBModel], PlayerInfo[playerid][vBX], PlayerInfo[playerid][vBY], PlayerInfo[playerid][vBZ],PlayerInfo[playerid][vBA],PlayerInfo[playerid][vBC1],PlayerInfo[playerid][vBC2],32000); SetVehicleVirtualWorld(PlayerInfo[playerid][pBVeh], GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(PlayerInfo[playerid][pBVeh], GetPlayerInterior(playerid)); ChangeVehiclePaintjob(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][vBPJ]); for(new i=0; i<14; i++) { AddVehicleComponent(PlayerInfo[playerid][pBVeh], PlayerInfo[playerid][pBVehMod][i]); } } return 1; }