18.04.2015, 11:50
hello,
I am making park command, and the problem I can type /park in any vehicle ( i want it only to his car ) also it destroys the vehicle and it dosen't spawn again
Here is my park command:
I am making park command, and the problem I can type /park in any vehicle ( i want it only to his car ) also it destroys the vehicle and it dosen't spawn again
Here is my park command:
PHP код:
CMD:park(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
new playername[MAX_PLAYER_NAME];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
GetPlayerName(playerid, playername, sizeof(playername));
if(!strcmp(VehicleInfo[vehicleid][vehOwner], playername, false) && !IsPlayerInVehicle(playerid, vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in your vehicle.");
{
new Float:parkvehX, Float:parkvehY, Float:parkvehZ;
GetVehiclePos(vehicleid, parkvehX, parkvehY, parkvehZ);
VehicleInfo[vehicleid][vehX] = parkvehX;
VehicleInfo[vehicleid][vehY] = parkvehY;
VehicleInfo[vehicleid][vehZ] = parkvehZ;
DestroyVehicle(vehicleid);
VehicleInfo[newvehicle][vehicle] = CreateVehicle(VehicleInfo[vehicleid][vehModel], VehicleInfo[vehicleid][vehX], VehicleInfo[vehicleid][vehY], VehicleInfo[vehicleid][vehZ], 0, -1, -1, -1);
return 1;
}
}