Destroy Vehicle -lil problem
#4

I don't know exactly whether this command will work well or not, yet check it.
pawn Код:
new VehicleSpawned[MAX_PLAYERS], IsSpawningFirstTime[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid) {
    IsSpawningFirstTime[playerid] = 0;
    return 1;
}
pawn Код:
CMD:v(playerid, params[]) {
    new P[3];
    GetPlayerPos(playerid, P[0], P[1], P[2]); // Use this positions to create the vehicle at your position.
    if(!IsSpawningFirstTime[playerid]) {
        VehicleSpawned[playerid] = CreateVehicle(...); // Continue this one as in your current command.
        PutPlayerInVehicle(playerid, VehicleSpawned[playerid], 0); // Places the playerid in the vehicle he created.
        IsSpawningFirstTime[playerid] = 1;
        return 1;
    }
    DestroyVehicle(VehicleSpawned[playerid]);
    VehicleSpawned[playerid] = CreateVehicle(...); // Continue this one as in your current command.
    PutPlayerInVehicle(playerid, VehicleSpawned[playerid], 0); // Places the playerid in the vehicle he created.
    return 1;
}
Reply


Messages In This Thread
Destroy Vehicle -lil problem - by FlawL3x - 14.02.2012, 19:57
Re: Destroy Vehicle -lil problem - by Jefff - 14.02.2012, 20:00
Re: Destroy Vehicle -lil problem - by FlawL3x - 14.02.2012, 20:08
Re: Destroy Vehicle -lil problem - by Toreno - 14.02.2012, 20:27
Re: Destroy Vehicle -lil problem - by FlawL3x - 14.02.2012, 20:36
Re: Destroy Vehicle -lil problem - by Toreno - 14.02.2012, 20:50
Re: Destroy Vehicle -lil problem - by FlawL3x - 15.02.2012, 19:40
Re: Destroy Vehicle -lil problem - by FlawL3x - 16.02.2012, 16:30

Forum Jump:


Users browsing this thread: 4 Guest(s)