Posts: 4,649
Threads: 64
Joined: Dec 2009
Reputation:
0
Y como se supone que te ayudemos si ni el codigo de tu comando has dejado.
Posts: 4,930
Threads: 467
Joined: Dec 2010
seguramente debes de tener el vehiculo que se crear con una variable, pero ocn variable global, utiliza variable con MAX_PLAYERS.
saludos.
Posts: 74
Threads: 22
Joined: Nov 2012
Reputation:
0
CrearAuto(playerid, modelid)
{
new Auto, Float: X, Float: Y, Float: Z, Float: Angulo;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
Auto = GetPlayerVehicleID(playerid);
GetVehiclePos(Auto, X, Y, Z);
GetVehicleZAngle(Auto, Angulo);
DestroyVehicle(Auto);
}
else
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angulo);
}
if(SpawnAuto[playerid] != 0) DestroyVehicle(SpawnAuto[playerid]);
SpawnAuto[playerid] = AddStaticVehicleEx(modelid, X, Y, Z, Angulo, -1, -1, 60);
PutPlayerInVehicle(playerid, SpawnAuto[playerid], 0);
LinkVehicleToInterior(Auto, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(Auto, GetPlayerVirtualWorld(playerid));
return 1;
}
Posts: 2,041
Threads: 97
Joined: Jun 2013
Infуrmate sobre AddStaticVehicleEx:
Quote:
Sуlo se puede utilizar cuando el servidor inicia primero (bajo OnGameModeInit ).
|
Asн que cambia 'AddStaticVehicleEx' por 'CreateVehicle'.
Posts: 4,930
Threads: 467
Joined: Dec 2010
pawn Код:
static AutoPlayer[MAX_PLAYERS];
stock CrearAuto(playerid, modelid){
new Float:pos[4];
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)return false;
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
DestroyVehicle(AutoPlayer[playerid]);
AutoPlayer[playerid] = CreateVehicle(modelid, pos[0], pos[1], pos[2], pos[3], random(200), random(200), 60);
PutPlayerInVehicle(playerid, AutoPlayer[playerid], 0);
LinkVehicleToInterior(AutoPlayer[playerid], GetPlayerInterior(playerid));
SetVehicleVirtualWorld(AutoPlayer[playerid], GetPlayerVirtualWorld(playerid));
return true;
}