How to check if the result is 1?
#1

I want to check if it's locked, but it won't go.

mysql_get_field( "Locked", vInfo[ vInfo[ vehicleid ][ Id ] ][ Locked ] );

I tryed

if(vInfo[ vInfo[ vehicleid ][ Id ] ][ Locked ] == 1 )


But it won't work. In the log i can see that it get's the right result. Should i use strval ? How should i do?
Reply
#2

You could make an stock:

pawn Код:
stock IsVehicleLocked(vehicleid)
{
     if(vInfo[vehicleid][Locked] == 1) return 1;
     return 0;
}
How to use it:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(IsVehicleLocked(vehicleid))
     {
           // Do shit if the vehicle is locked.
     }
}
Btw, you might want to check out my fresh tutorial https://sampforum.blast.hk/showthread.php?tid=186495
Reply
#3

Is it possible to do it simply without stock ?
Reply
#4

Never ever used mysql_fetch_field before.. though i'm sure this will work.
pawn Код:
new Lockedvehicle[10];
mysql_fetch_field("FieldName", LockedVehicle);
printf("%s",LockedVehicle);
vInfo[vehicleid][Locked] = strval(LockedVehicle);
printf("%d",vInfo[vehicleid][Locked);
EDIT: The prints is to debug btw.
Reply
#5

Thank's.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)