SA-MP Forums Archive
A lil' help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A lil' help (/showthread.php?tid=249786)



A lil' help - [MWR]Blood - 20.04.2011

Hey, so here goes my code:

pawn Код:
CreatePlayerVehicle( playerid, modelid )
{
    new
        Float:x,
        Float:y,
        Float:z,
        Float:a;
        GetPlayerFacingAngle(playerid, a);
        GetPlayerPos(playerid, x, y, z);
        if(IsPlayerInAnyVehicle(playerid) == 1)
        {
            GetXYInFrontOfPlayer(playerid, x, y, 8);
        }
        else
        {
            GetXYInFrontOfPlayer(playerid, x, y, 5);
        }
    DestroyVehicle(PlayerCar[playerid]);
    PlayerCar[playerid] = CreateVehicle(modelid, x, y, z, a, -1, -1, -1);
    LinkVehicleToInterior(PlayerCar[playerid], GetPlayerInterior(playerid));
    PutPlayerInVehicle(playerid, PlayerCar[playerid], 0);
    return 1;
}
But when I spawn a vehicle(Ex. NRG) it destroys another player's vehicle.
And if he does Ex. /v elegy it destroys my NRG and so on.
Could you help me?
Thanks.


Re: A lil' help - [MWR]Blood - 21.04.2011

Bump...


Re: A lil' help - aircombat - 21.04.2011

try using AddStaticVehicle