SA-MP Forums Archive
help with mysql system - 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: help with mysql system (/showthread.php?tid=358982)



help with mysql system - MA_proking - 12.07.2012

Please help me with this
pawn Код:
enum bInfo
{
    banid,
    bip[64],
    bname[40],
    banner[40],
    breason[256]
}

new BannedInfo[MAX_PLAYERS][bInfo];
stock BanInfo(ip[],playerid)
{
    new query[300], pname[24], savingstring[20];
    GetPlayerName(playerid, pname, 24);
    format(query, sizeof(query), "SELECT  banid, ip, name, banner, reason FROM bans WHERE `ip` = '%s'", ip);
    mysql_query(query);

    mysql_store_result();
    while(mysql_fetch_row_format(query,"|"))
    {
        mysql_fetch_field_row(savingstring, "banid"); SetPVarInt(playerid,BannedInfo[playerid][banid],savingstring) = = strval(savingstring);
        mysql_fetch_field_row(savingstring, "ip"); SetPVarString(playerid,BannedInfo[playerid][bip],savingstring) = = strval(savingstring);
        mysql_fetch_field_row(savingstring, "name"); SetPVarString(playerid,BannedInfo[playerid][bname],savingstring) = = strval(savingstring);
        mysql_fetch_field_row(savingstring, "banner"); SetPVarString(playerid,BannedInfo[playerid][banner],savingstring) = = strval(savingstring);;
        mysql_fetch_field_row(savingstring, "reason"); SetPVarString(playerid,BannedInfo[playerid][breason],savingstring) = = strval(savingstring);
    }
    mysql_free_result();
    return 1;
}

Getting these errors:
Код:
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2679) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2679) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2680) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2680) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2681) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2681) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2682) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2682) : error 029: invalid expression, assumed zero
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2682) : error 036: empty statement
C:\Documents and Settings\PRABHAT ZONE\Desktop\LAdmin4v2\zombie\gamemodes\zom0rev2.pwn(2682) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


10 Errors.