[Duda] Hacer que una funciуn se realice 1 ves
#8

pawn Код:
stock LoadPlayerVehicles(playerid)
{
        if(GetPVarInt(playerid, "VehiclesLoaded")) return 1;
        SetPVarInt(playerid, "VehiclesLoaded", 1);
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    //printf(" Cargado los autos de %s.", playername);
    for(new v = 0; v < MAX_PLAYERVEHICLES; v++)
    {
        if(PlayerVehicleInfo[playerid][v][pvModelId] != 0 && PlayerVehicleInfo[playerid][v][pvImpounded] == 0)
        {
            PlayerCars++;
            new carcreated = CreateVehicle(PlayerVehicleInfo[playerid][v][pvModelId], PlayerVehicleInfo[playerid][v][pvPosX], PlayerVehicleInfo[playerid][v][pvPosY], PlayerVehicleInfo[playerid][v][pvPosZ], PlayerVehicleInfo[playerid][v][pvPosAngle],PlayerVehicleInfo[playerid][v][pvColor1], PlayerVehicleInfo[playerid][v][pvColor2], -1);
            PlayerVehicleInfo[playerid][v][pvId] = carcreated;
            VehicleFuel[carcreated] = PlayerVehicleInfo[playerid][v][pvFuel];
            //SetVehicleNumberPlate(carcreated, PlayerVehicleInfo[playerid][v][pvNumberPlate]);
            if(PlayerVehicleInfo[playerid][v][pvLocked] == 1) LockPlayerVehicle(playerid, PlayerVehicleInfo[playerid][v][pvId], PlayerVehicleInfo[playerid][v][pvLock]);
        }
        else if(PlayerVehicleInfo[playerid][v][pvModelId] == 0 && PlayerVehicleInfo[playerid][v][pvImpounded] != 0)
            PlayerVehicleInfo[playerid][v][pvImpounded] = 0;
    }
    LoadAllPlayerVehicleMods(playerid);
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)