09.02.2010, 19:03
hi,i'm looking for a function like giveplayeridcar to give a player a specific id car(car id from /oldcar)or something like this.exist?
stock giveplayeridcar(playerid, vehicleid, forceout=false)
{
new Float:X, Float:Y, Float:Z, Float:A;
GetVehiclePos(vehicleid, X, Y, Z);
if(X==0 && Y==0 && Z == 0) return 0;
for(new pid=0; pid < GetMaxPlayers(); pid++)
{
if(!IsPlayerConnected(pid) || GetPlayerVehicleID(pid)!=vehicleid) continue;
if(!forceout) return 0;
RemovePlayerFromVehicle(pid);
}
GetPlayerPos(pid, X, Y, Z);
GetPlayerFacingAngle(pid, A);
SetVehiclePos(X,Y,Z);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleZAngle(vehicleid, A);
return 1;
}