SA-MP Forums Archive
MySQL help making a function in game. - 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)
+--- Thread: MySQL help making a function in game. (/showthread.php?tid=417876)



MySQL help making a function in game. - PaulDinam - 22.02.2013

I'm made a dynamic vehicle system and each vehicle has a Type.
Type 1 = RENT_VEHICLE

I need a function in game that checks if the player is inside a rented vehicle which has Type = 1



I've tried something like this but it does not work:

EDIT: Nevermind I made it

pawn Код:
public IsARenting(vehicle)
{
    new bool:found = false;
    for(new i = 0; i < sizeof(VehicleInfo); i++)
    {
        if(VehicleInfo[i][vCarOn] && VehicleInfo[i][vType] == RENT_VEHICLE && vehicle == VehicleInfo[i][vVehicle])
        {
            found = true;
            break;
        }
    }
    return found;
}