22.09.2013, 21:51
https://sampwiki.blast.hk/wiki/SetVehicleVirtualWorld
y para el otro..
pawn Код:
zcmd(gentrar, playerid, params[])
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hgEntrancex], HouseInfo[i][hgEntrancey], HouseInfo[i][hgEntrancez]))
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
if(GetPlayerState(playerid) == 2){
SetVehiclePos(GetPlayerVehicleID(playerid), HouseInfo[i][hgExitx], HouseInfo[i][hgExity], HouseInfo[i][hgExitz]); // linea del waring
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), HouseInfo[i][hgWorld]);
}
else{
SetPosEx(playerid, HouseInfo[i][hgExitx],HouseInfo[i][hgExity],HouseInfo[i][hgExitz],0,HouseInfo[i][hgInt],HouseInfo[i][hgWorld]);
return 1;
}
}
else
{
GameTextForPlayer(playerid, "~r~Garage cerrado", 5000, 1);
}
}
}
}
return 1;
}
y para el otro..
pawn Код:
zcmd(gsalir, playerid, params[])
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
if(NoFuel[playerid] == 1)
{
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicle(playerid);
NoFuel[playerid] = 0;
}
else if(PlayerInfo[playerid][pEntered] != -1)
{
if(GetPlayerState(playerid) == 2){
SetVehiclePos(GetPlayerVehicleID(playerid), HouseInfo[i][hgEntracex], HouseInfo[i][hgEntracey], HouseInfo[i][hgEntracez]); // linea del waring
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), 0);
}else{
new key = PlayerInfo[playerid][pEntered];
SetPosEx(playerid, HouseInfo[key][hgEntrancex],HouseInfo[key][hgEntrancey],HouseInfo[key][hgEntrancez],0,0,0);
}
}
return 1;
}