Somethings worng..
#1

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(IsPlayerInAnyVehicle(forplayerid) && PlayerIsInDM[forplayerid] == false) //seems to work
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
            {
                SetVehicleHealth(GetPlayerVehicleID(forplayerid), 999999.0);
            }
        }
    }
    if(IsPlayerInAnyVehicle(forplayerid) && PlayerIsInDM[forplayerid] == true)//Does not work cars are still invincible.
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
            {
                SetVehicleHealth(GetPlayerVehicleID(forplayerid), 1000.0);
            }
        }
    }
    if(IsPlayerInAnyVehicle(forplayerid) && Locked[forplayerid] == true)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i))
            {
                SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
            }
        }
    }
}
Please help. I'm not sure why its doing this.
Reply
#2

well what you're doing doesn't make sense...

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(IsPlayerInAnyVehicle(forplayerid) && !PlayerIsInDM[forplayerid]) //seems to work
    {
        for(new i = 0; i < MAX_PLAYERS; i++) // you're looping through every player
        {
            if(IsPlayerConnected(i)) // you're checking if that player is connected
            {
                SetVehicleHealth(GetPlayerVehicleID(forplayerid), 999999.0); // then you're setting the health of one car all those times....
            }
        }
    }
    if(IsPlayerInAnyVehicle(forplayerid) && PlayerIsInDM[forplayerid] == true)//Does not work cars are still invincible.
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                SetVehicleHealth(GetPlayerVehicleID(forplayerid), 1000.0); // same thing here, setting the health of one car many times
            }
        }
    }
    if(IsPlayerInAnyVehicle(forplayerid) && Locked[forplayerid] == true)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
            }
        }
    }
}
Reply
#3

well um what am I suppose to do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)