06.07.2011, 13:30
Oops, I totally forgot about this tutorial, just got reminded by someone who PMed me about it
@Dirkon: The error is caused by a stupid mistake i made.
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[20])
has to be
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
of course, and the array size of owner in carDataEnum has to be MAX_PLAYER_NAME too. (I also updated the first post now)
@bijoyekuza: The owner is what you set in CreateVehicleEx, and you can simply get it with carData[vehicleid][owner]. The code you made should do it.
For a /park command just change the x/y/zspawn coordinates for carData[vehicleid], as well as the rotation of it (anglespawn) and add this to the top of your OnVehicleSpawn callback:
@Dirkon: The error is caused by a stupid mistake i made.
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[20])
has to be
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
of course, and the array size of owner in carDataEnum has to be MAX_PLAYER_NAME too. (I also updated the first post now)
@bijoyekuza: The owner is what you set in CreateVehicleEx, and you can simply get it with carData[vehicleid][owner]. The code you made should do it.
For a /park command just change the x/y/zspawn coordinates for carData[vehicleid], as well as the rotation of it (anglespawn) and add this to the top of your OnVehicleSpawn callback:
pawn Code:
SetVehiclePos(vehicleid, carData[vehicleid][xspawn], carData[vehicleid][yspawn], carData[vehicleid][zspawn]);
// This will teleport the vehicle to its updated spawn position on spawn
SetVehicleZAngle(vehicleid, carData[vehicleid][anglespawn]);
// and sets it rotation to the stored spawn angle.