SA-MP Forums Archive
Help... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help... (/showthread.php?tid=268712)



Help... - Edvin - 13.07.2011

Hi guys i make a V.I.P system with 3 levels...and i have a problem on SQL reading...

Let's start...
if i set me a level with /setvip [playerid] [level] it works any command and everythink is write in database(vip level, name)...and commands for VIPs works..BUT...
when i connect second time when i write any command it says me i don't have V.I.P level 1 and in database says me i have VIP level 3 why?...i try to put this on OnPlayerConnect...i'm not sure if it is very correct here it is:
pawn Код:
public OnPlayerConnect( playerid )
{
    new Query[ 256 ];
   
    for ( new i = 0; i < P_DATA[ i ][ Vip ]; i++ )
    {
        format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Name` = '%s' ", PlayerName2( playerid ) );
        P_DATA[ i ][ Vip ]++;
        db_free_result( db_query( Database, Query ) );
    }
    return 1;
}
so...how i can make this?


Re: Help... - Edvin - 13.07.2011

sorry for duble post i forgot to use db_get_field_assoc...lol...i resolved!