===== Some Errors ======
#1

pawn Код:
(516) : error 012: invalid function call, not a valid address
(516) : warning 215: expression has no effect
(516) : error 001: expected token: ";", but found ")"
(516) : error 029: invalid expression, assumed zero
(516) : fatal error 107: too many error messages on one line
And The Line:
pawn Код:
format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName( playerid ) );
Reply
#2

pawn Код:
format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName( playerid ) ;
This might help, not sure though, give me more of the surrounding code so i can test it
Reply
#3

That's the all code:
pawn Код:
new
        Query[ 256 ],
        DBResult:Result,
        Field[ 30 ]
    ;

    format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName( playerid ) ;
    Result = db_query( Database, Query );

    if ( Result )
    {
        if ( db_num_rows( Result ) )
        {
            db_get_field_assoc( Result, "VipLevel", Field, 4 ); P_DATA[ playerid ][ Vip ] = strval( Field );
            db_get_field_assoc( Result, "VSkin", Field, 4 );    P_DATA[ playerid ][ p_FavSkin ] = strval( Field );

            #if defined SHOW_LEVEL_DIALOG
            format( string, sizeof( string ), "\t{FF5500}Your V.I.P Level:\n\n{FF5500}You have V.I.P level {00FF00}%d\n\n{E60000}Congratulations!", P_DATA[ playerid ][ Vip ] );
            ShowPlayerDialog( playerid, ONCONN, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", string, "Quit", "" );
            #endif
        }
        else
        {
            P_DATA[ playerid ][ Vip ] = 0;
            P_DATA[ playerid ][ p_FavSkin ] = -1;

            format( Query, sizeof Query, "INSERT INTO `Vips` VALUES(NULL,'%s','0','-1')", PlayerName( playerid ) );
            db_query( Database, Query );

            #if defined SHOW_LEVEL_DIALOG
            ShowPlayerDialog( playerid, ONCONN+1, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", "{E60000}This username have V.I.P level 0", "Quit", "" );
            #endif
        }
        db_free_result( Result );
    }
Reply
#4

Normally there's no spaces between [Vip] etc... witch makes it look really weird to me.
Reply
#5

Without spaces:
pawn Код:
new
        Query[ 256 ],
        DBResult:Result,
        Field[ 30 ]
    ;

    format(Query, sizeof(Query),"SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName(playerid) ;
    Result = db_query(Database,Query);

    if(Result)
    {
        if (db_num_rows(Result))
        {
            db_get_field_assoc(Result,"VipLevel",Field,4); P_DATA[playerid][Vip] = strval(Field);
            db_get_field_assoc(Result,"VSkin",Field,4); P_DATA[playerid][p_FavSkin] = strval(Field);
        }
        else
        {
            P_DATA[playerid][Vip] = 0;
            P_DATA[playerid][p_FavSkin] = -1;

            format(Query,sizeof Query,"INSERT INTO `Vips` VALUES(NULL,'%s','0','-1')",PlayerName(playerid));
            db_query(Database,Query);
        }
        db_free_result(Result);
    }
Reply
#6

PHP код:
new Query256 ],DBResult:Result,Field30 ];
    
formatQuerysizeofQuery ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'"PlayerName(playerid));
    
Result db_queryDatabaseQuery );
    if ( 
Result )
    {
        if ( 
db_num_rowsResult ) )
        {
            
db_get_field_assocResult"VipLevel"Field); P_DATAplayerid ][ Vip ] = strvalField );
            
db_get_field_assocResult"VSkin"Field);    P_DATAplayerid ][ p_FavSkin ] = strvalField );
            
#if defined SHOW_LEVEL_DIALOG
            
formatstringsizeof( string ), "\t{FF5500}Your V.I.P Level:\n\n{FF5500}You have V.I.P level {00FF00}%d\n\n{E60000}Congratulations!"P_DATAplayerid ][ Vip ] );
            
ShowPlayerDialogplayeridONCONNDIALOG_STYLE_MSGBOX"{00FF00}V.I.P"string"Quit""" );
            
#endif
        
}
        else
        {
            
P_DATAplayerid ][ Vip ] = 0;
            
P_DATAplayerid ][ p_FavSkin ] = -1;
            
formatQuerysizeof Query"INSERT INTO `Vips` VALUES(NULL,'%s','0','-1')"PlayerNameplayerid ) );
            
db_queryDatabaseQuery );
            
#if defined SHOW_LEVEL_DIALOG
            
ShowPlayerDialogplayeridONCONN+1DIALOG_STYLE_MSGBOX"{00FF00}V.I.P""{E60000}This username have V.I.P level 0""Quit""" );
            
#endif
        
}
        
db_free_resultResult );
    } 
never worked with these type of codes so tell if worked.
Reply
#7

Same errors..
Reply
#8

Try this,
pawn Код:
public OnPlayerConnect( playerid )
{
    if(P_DATA[playerid][Vip] >= 1){
    new
    Query[ 256 ],
    string[ 128 ],
    DBResult:Result,
    Field[ 30 ],
    pname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pname, sizeof(pname));
    format(string,sizeof(string),"Welcome %s (%i).Your Courent Level: %s",pname,playerid,P_DATA[playerid][Vip]);
    SendClientMessage(playerid,ANY COLOUR,string);
    format( Query, sizeof( Query ), "SELECT * FROM `Vips` WHERE `Nume` = '%s'", PlayerName( playerid ) );
    Result = db_query( Database, Query );

    if ( Result )
    {
    if ( db_num_rows( Result ) )
    {
    db_get_field_assoc( Result, "VipLevel", Field, 4 ); P_DATA[ playerid ][ Vip ] = strval( Field );
    db_get_field_assoc( Result, "VSkin", Field, 4 ); P_DATA[ playerid ][ p_FavSkin ] = strval( Field );

    #if defined SHOW_LEVEL_DIALOG
    format( string, sizeof( string ), "\t{FF5500}Tvoj VIP Level :\n\n{FF5500}Postali ste VIP level {00FF00}%d\n\n{E60000}Cestitamo!", P_DATA[ playerid ][ Vip ] );
    ShowPlayerDialog( playerid, ONCONN, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", string, "Quit", "" );
    #endif
    }
    else
    {
    P_DATA[ playerid ][ Vip ] = 0;
    P_DATA[ playerid ][ p_FavSkin ] = -1;

    format( Query, sizeof Query, "INSERT INTO `Vips` VALUES(NULL,'%s','0','-1')", PlayerName( playerid ) );
    db_query( Database, Query );

    #if defined SHOW_LEVEL_DIALOG
    ShowPlayerDialog( playerid, ONCONN+1, DIALOG_STYLE_MSGBOX, "{00FF00}V.I.P", "{E60000}Ovaj korisnik ima VIP Level 0", "Quit", "" );
    #endif
    }
    db_free_result( Result );
    }
    return 1;
}
Not tested.
Reply
#9

Can you show the PlayerName() function?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)