MySQL Problem..
#1

Hi..
i'm still learning mysql so don't judge me :P ( i'm ini scripter )
anyway
PHP код:
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(1243) : error 076syntax error in the expression, or invalid function call
C
:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(1246) : error 076syntax error in the expression, or invalid function call
C
:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26693) : warning 235: public function lacks forward declaration (symbol "Banip")
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26706) : warning 235: public function lacks forward declaration (symbol "BanCheck")
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 012invalid function callnot a valid address
C
:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : warning 215expression has no effect
C
:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 001expected token";"but found ")"
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 029invalid expressionassumed zero
C
:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
7 Errors

well.. is there wrong with my codes -_-
Line: 1243
PHP код:
         PlayerInfo[i][Time] += 1
Full code:
Код:
public PlayersData() {
   foreach (new i : Player) {
	   if(IsPlayerConnected(i)) {
         PlayerInfo[i][Time] += 1;
		 if(PlayerInfo[i][Registered] == 1 && PlayerInfo[i][LoggedIn] == 1) {
           new Query[250];
           format(Query, sizeof(Query),"UPDATE `accounts` SET `Score` = '%d',`Money` = '%d',`TimeOnServer` = '%d' WHERE `Name` = '%s'",GetPlayerScore(i),GetPlayerMoney(i),PlayerInfo[i][Time],pName(i));
           mysql_tquery(mysql, Query, "", "");
	     }
	  }
    }
}
And line 26711:
PHP код:
         format(Querysizeof(Query),"UPDATE `banneds` SET `ip` = '%s' WHERE `name` = '%s'",pIP(playerid),pName(playerid)); 
full code:
PHP код:
public BanCheck(playerid) {
    new 
rowsfields,ibanned[10][2],ifbanned[2],save[4][80],Query[250];
    
cache_get_data(rowsfieldsmysql);
    if(
rows)
    {
         
format(Querysizeof(Query),"UPDATE `banneds` SET `ip` = '%s' WHERE `name` = '%s'",pIP(playerid),pName(playerid));
         
mysql_tquery(mysqlQuery"""");
         
cache_get_field_content(0"banned"ibanned[0], mysql10);
         
ifbanned[0] = strval(ibanned[0]);
         if(
ifbanned[0] == 1) {
         
cache_get_field_content(0"date"save[0], mysql80);
         
cache_get_field_content(0"time"save[1], mysql80);
         
cache_get_field_content(0"bannedby"save[2], mysql80);
         
cache_get_field_content(0"reason"save[3], mysql80);
         new 
str[550],content[128]; format(content,sizeof content,"%s %s",save[0],save[1]);
         
format(strsizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: coming soon",pName(playerid),save[2],content,save[3]);
         
ShowPlayerDialog(playerid801DIALOG_STYLE_MSGBOX"{FF0000}You Are Banned!"str"Close","");
         
SetTimerEx("kickplayer"3000false"i"playerid);
         return 
1;
         } else if(
ifbanned[0] == 0) {
         
cache_get_field_content(0"tempban"ibanned[1], mysql10);
         
ifbanned[1] = strval(ibanned[1]);
         if(
ifbanned[1] == 1) {
         new 
whatdate;
         
whatdate cache_get_field_content_int(0,"bdate",mysql);
         new 
Year,Month,Day,tempbandate[3],string;
         
getdate(YearMonthDay);
         
tempbandate[0] = 60 60 24 Year;
         
tempbandate[1] = 60 60 24 30 Month;
         
tempbandate[2] = 60 60 24 Day;
         
string tempbandate[0]+tempbandate[1]+tempbandate[2];
         if(
whatdate string <= 0) {
           
format(Querysizeof(Query),"UPDATE `banneds` SET `tempban` = 0,`bannedby` = %d,`reason` = %d WHERE `name` = '%s'",0,0,pName(playerid));
           
mysql_tquery(mysqlQuery"""");
           
format(Query100"DELETE FROM `bannedips` WHERE `ip` = '%s'",pIP(playerid));
           
mysql_tquery(mysqlQuery"""");
           return 
SendClientMessage(playerid0x33FF33AA,"Ban BOT: |- Your Ban Has been Expired -|");
         }
         new 
saves[3][128],by[128],expire;
         
cache_get_field_content(0"date"saves[0], mysql128);
         
cache_get_field_content(0"time"saves[1], mysql128);
         
cache_get_field_content(0"reason"saves[2], mysql128);
         
cache_get_field_content(0"bannedby"bymysql128);
         
expire cache_get_field_content_int(0"bdate",mysql);
         new 
str[550],content[128]; format(content,sizeof content,"%s %s",saves[0],saves[1]);
         
expire -= string;
         
expire /= 86400;
         if(
expire == 1) {
           
format(strsizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{00FFFF}Ban Expire After: {33FF33}%d Day\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: comingsoon"\
           ,
pName(playerid),by,content,saves[2],expire);
         }
         if(
expire 1) {
           
format(strsizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{00FFFF}Ban Expire After: {33FF33}%d Days\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: comingsoon"\
           ,
pName(playerid),by,content,saves[2],expire);
         }
         
ShowPlayerDialog(playerid801DIALOG_STYLE_MSGBOX"{FF0000}You Are Temporary Banned!"str"Close","");
         
SetTimerEx("kickplayer"3000false"i"playerid);
         return 
1;
         }
         }
         if(
ifbanned[1] == 0) {
             
banrows[playerid] = 1;
             
format(Querysizeof(Query), "SELECT * FROM `bannedips` WHERE `ip` = '%s'"pIP(playerid));
             
mysql_tquery(mysqlQuery"BanIPCheck""i"playerid);
         }
      }
       if(!
rows)
    {
     
format(Querysizeof(Query), "SELECT * FROM `bannedips` WHERE `ip` = '%s'"pIP(playerid));
     
mysql_tquery(mysqlQuery"BanIPCheck""i"playerid);
     }
    return 
1;

Reply


Messages In This Thread
MySQL Problem.. - by Younes44 - 16.12.2016, 15:26
Re: MySQL Problem.. - by Logic_ - 16.12.2016, 15:32
Re: MySQL Problem.. - by X337 - 16.12.2016, 15:50
Re: MySQL Problem.. - by Younes44 - 16.12.2016, 16:01
Re: MySQL Problem.. - by Runn3R - 16.12.2016, 18:36
Re: MySQL Problem.. - by Younes44 - 16.12.2016, 19:05
Re: MySQL Problem.. - by Logic_ - 17.12.2016, 06:51
Re: MySQL Problem.. - by Younes44 - 17.12.2016, 07:59

Forum Jump:


Users browsing this thread: 2 Guest(s)