Really need help about mysql
#1

So I tried to running my one of my old script, compile it and got those errors

PHP код:
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2579) : error 017undefined symbol "mysql"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2580) : error 017undefined symbol "mysql_store_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2581) : error 017undefined symbol "mysql_fetch_field"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2582) : error 017undefined symbol "mysql_fetch_field"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2583) : error 017undefined symbol "mysql_free_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8726) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8728) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8735) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8737) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8744) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8745) : error 017undefined symbol "mysql_store_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8746) : error 017undefined symbol "mysql_fetch_int"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8747) : error 017undefined symbol "mysql_free_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8750) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8751) : error 017undefined symbol "mysql_store_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8752) : error 017undefined symbol "mysql_fetch_int"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8753) : error 017undefined symbol "mysql_free_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8758) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8760) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8773) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8774) : error 017undefined symbol "mysql_store_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8775) : error 017undefined symbol "mysql_fetch_int"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8776) : error 017undefined symbol "mysql_free_result"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8781) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8783) : error 035argument type mismatch (argument 1)
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(8796) : error 035argument type mismatch (argument 1
So those lines contains:
(2580 to 2583)
PHP код:
mysql_store_result();
        
mysql_fetch_field("Banned" ,Data); PlayerInfo[playerid][pBanned] = strval(Data);
         
mysql_fetch_field("BanReason" ,Data); strmid(PlayerInfo[playerid][pBanReason], Data0strlen(Data), 255);
        
mysql_free_result(); 
(8726 to 8728 ):
PHP код:
mysql_query(query);
                    
format(query,sizeof(query),"UPDATE players SET SpawnInfo=%d WHERE id=%d",Spawn_LVNorth,PlayerInfo[playerid][pSQLID]);
                    
mysql_query(query); 
(8735 to 8738 ):
PHP код:
mysql_query(query);
                    
format(query,sizeof(query),"UPDATE players SET SpawnInfo=%d WHERE id=%d",Spawn_LVSouth,PlayerInfo[playerid][pSQLID]);
                    
mysql_query(query); 
(8744 to 8760):
PHP код:
    mysql_query(query);
                    
mysql_store_result();
                    
PlayerInfo[playerid][pLeader]=mysql_fetch_int();
                    
mysql_free_result();
                    
                    
format(query,sizeof(query),"SELECT Member FROM players WHERE id=%d",PlayerInfo[playerid][pSQLID]);
                    
mysql_query(query);
                    
mysql_store_result();
                    
PlayerInfo[playerid][pMember]=mysql_fetch_int();
                    
mysql_free_result();
                    
                    if(
PlayerInfo[playerid][pLeader] > || PlayerInfo[playerid][pMember]> 0)
                    {
                        
format(query,sizeof(query),"UPDATE players SET Crashed=0 WHERE id=%d",PlayerInfo[playerid][pSQLID]);
                          
mysql_query(query);
                        
format(query,sizeof(query),"UPDATE players SET SpawnInfo=%d WHERE id=%d",Spawn_AtOffice,PlayerInfo[playerid][pSQLID]);
                          
mysql_query(query); 
(8773 to 8783):
PHP код:
mysql_query(query);
                    
mysql_store_result();
                    
PlayerInfo[playerid][pPhousekey]=mysql_fetch_int();
                    
mysql_free_result();
                    if(
PlayerInfo[playerid][pPhousekey] != 999999)
                    {
                        
format(query,sizeof(query),"UPDATE players SET Crashed=0 WHERE id=%d",PlayerInfo[playerid][pSQLID]);
                          
mysql_query(query);
                        
format(query,sizeof(query),"UPDATE players SET SpawnInfo=%d WHERE id=%d",Spawn_AtHome,PlayerInfo[playerid][pSQLID]);
                          
mysql_query(query); 
anddd (8796)
PHP код:
mysql_query(query); 
So you'll see it is mostly mysql problems, as I'm new to this I kinda not sure what went wrong. Any comments are really appreciated.

Thanks in advance!
Reply
#2

Change to appropriate mysql version
Reply
#3

Quote:
Originally Posted by coool
Посмотреть сообщение
Change to appropriate mysql version
So do I need to run on the older mysql version or have to change my code? I'm like very new to this haha as I got the code from my brother and try to learning here.
Reply
#4

Quote:
Originally Posted by pote2639
Посмотреть сообщение
So do I need to run on the older mysql version or have to change my code? I'm like very new to this haha as I got the code from my brother and try to learning here.
Why would you want to use something old? Open up your server folder, go to pawno/include/a_mysql.inc. There you will be able to see the mysql plugin version you are using.
Reply
#5

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Why would you want to use something old? Open up your server folder, go to pawno/include/a_mysql.inc. There you will be able to see the mysql plugin version you are using.
Yup, I'm using the latest version (R41-2) So I guess that's why my code isn't compatible with my script I guess.
Reply
#6

Quote:
Originally Posted by pote2639
Посмотреть сообщение
Yup, I'm using the latest version (R41-2) So I guess that's why my code isn't compatible with my script I guess.
You are using the latest version, but you are using outdated functions (that are not in the latest version anymore) and don't exist in your current version.

https://sampwiki.blast.hk/wiki/MySQL/R40
Reply
#7

Hmm, So I tried to replace my first batch of my code, here's result

PHP код:
public OnPlayerDisconnect(MAX_PLAYER_NAME);
            {
             {
              new
                  
szString[64],
                  
playerName[MAX_PLAYER_NAME];
              
GetPlayerName(playeridplayerNameMAX_PLAYER_NAME);
              new 
szDisconnectReason[3][] =
              {
                  
"Timeout/Crash",
                  
"Quit",
                  
"Kick/Ban"
              
};
              
format(szStringsizeof szString"%s left the server (%s)."playerNameszDisconnectReason[reason]);
              
SendClientMessageToAll(0xC4C4C4FFszString);
              return 
1;
            }
                    
cache_delete(Player[playerid][Data]);
                    
// ...
                    
return 1;
            }
          if(
PlayerInfo[playerid][pBanned] == 1
But I got this instead

PHP код:
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2590) : error 029invalid expressionassumed zero
C
:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2606) : error 017undefined symbol "reason"
C:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2611) : warning 225unreachable code
C
:\Users\pote2\Desktop\samp server\pawno\darkproject.pwn(2615) : warning 225unreachable code 
Any ideas? thank you.
Reply
#8

https://sampwiki.blast.hk/wiki/OnPlayerDisconnect

Missing Parameter
Reply
#9

Making multiple posts in a row is not allowed. Use the edit () button. Bumping a topic is allowed after 24 hours by the way.

pawn Код:
public OnPlayerDisconnect(MAX_PLAYER_NAME);
https://sampwiki.blast.hk/wiki/OnPlayerDisconnect

You accidentally edited it or used a tool which replaces every part of text that is found into something else.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)