#1

First of all, Hello samp-forums every one knows YG gamemode so i have a copy and have a bug

That if the player not registered he can view /stats if he registered and logged in if he typed /stats All the server Get down
Reply
#2

Any help?
Reply
#3

show us the /stats commands.
Reply
#4

PHP код:
#if defined USE_STATS
CMD:stats(playerid,params[]) {
    new 
pDeathsplayer1hms;
    new 
Query[256], pname[24], i[128];
    new 
rdate[32], rtime[32], lodate[32], lotime[32];
    new 
string[1250], lvlstring[256];
    new 
rankdon[50], rankdon2[50], playeruserid;
    if(
isnull(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
        
TotalGameTime(player1hms);
        
GetPlayerName(playeridpname24);
         if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths];
            if(
PlayerInfo[player1][Level] > 3)
            {
                
format(lvlstringsizeof(lvlstring), ""ccwhite"Admin level: "ccgreen"%d"ccwhite", VIP level: "ccgreen"0",PlayerInfo[player1][Level]); // Since max vip level is 3...
            
}
            else
            {
                
format(lvlstringsizeof(lvlstring), ""ccwhite"Admin level: "ccgreen"0"ccwhite", VIP level: "ccgreen"%d",PlayerInfo[player1][Level]);
             }
            switch(
PlayerInfo[player1][YG])
            {
                case 
0rankdon "No";
                case 
1rankdon "Yes";
            }
            switch(
PlayerInfo[player1][TP])
            {
                case 
0rankdon2 "No";
                case 
1rankdon2 "Yes";
            }
            
format(Querysizeof(Query), "SELECT RegisteredDate, RegisteredTime, LastOnlineDate, LastOnlineTime, id FROM `playerdata` WHERE `user` = '%s' LIMIT 1"pName(player1));
            
mysql_query(Query);
            
mysql_store_result();
            if(
mysql_num_rows() != 0)
            {
                while(
mysql_fetch_row_format(Query"|"))
                {
                    
mysql_fetch_field_row(i"RegisteredDate"); format(rdatesizeof(rdate), i);
                    
mysql_fetch_field_row(i"RegisteredTime"); format(rtimesizeof(rtime), i);
                    
mysql_fetch_field_row(i"LastOnlineDate"); format(lodatesizeof(lodate), i);
                    
mysql_fetch_field_row(i"LastOnlineTime"); format(lotimesizeof(lotime), i);
                    
mysql_fetch_field_row(i"id"); playeruserid strval(i);
                }
                    
format(stringsizeof(string),"\t\t\t\t"ccorange"limitx Stats for %s (ID:%d)..."PlayerName2(player1), player1);
                    
format(stringsizeof(string), "%s\n\n"ccwhite"Kills: "ccgreen"%d"ccwhite", Deaths: "ccgreen"%d "ccwhite"--> Ratio of "ccgreen"%0.2f "ccwhite"kills per death, Admin kills: "ccgreen"%d",stringPlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeathsPlayerInfo[player1][AdminKills]);
                    
format(stringsizeof(string), "%s\n"ccwhite"limitx Status: "ccgreen"%s"ccwhite", TP Status: "ccgreen"%s"ccwhite", Skin: "ccgreen"%d"ccwhite", Maths Quiz won: "ccgreen"%d",stringrankdonrankdon2GetPlayerSkin(player1),PlayerInfo[player1][ReactionTestWon]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Cookies: "ccgreen"%d"ccwhite", Cakes: "ccgreen"%d"ccwhite", Biscuits: "ccgreen"%d"ccwhite", Ice Creames: "ccgreen"%d"ccwhite", Race Won: "ccgreen"%d",stringPlayerInfo[player1][Cookies],PlayerInfo[player1][Cakes],PlayerInfo[player1][Biscuits],PlayerInfo[player1][IceCreams], PlayerInfo[player1][RaceWon]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Money/Cash: "ccgreen"$%d "ccwhite"~ Banked Money/Cash: "ccgreen"$%d"ccwhite", Total Commands Used: "ccgreen"%d"ccwhite", Total Complaints: "ccgreen"%d",stringGetPlayerMoney(player1),PlayerInfo[player1][bank],PlayerInfo[player1][Totcmdsused],PlayerInfo[player1][pReports]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Total Logins: "ccgreen"%d"ccwhite", Total Kicks: "ccgreen"%d"ccwhite", Total Bans: "ccgreen"%d"ccwhite", Total Warnings: "ccgreen"%d, %s",stringPlayerInfo[player1][Totallogins],PlayerInfo[player1][Totalkicks], PlayerInfo[player1][Totalbans], PlayerInfo[player1][Totalwarnings], lvlstring);
                    
format(stringsizeof(string), "%s\n"ccwhite"Played "ccgreen"%d "ccwhite"hours, "ccgreen"%d "ccwhite"minutes, "ccgreen"%d "ccwhite"seconds ~ User ID: "ccgreen"%d",stringPlayerInfo[player1][pHour],PlayerInfo[player1][pMin], PlayerInfo[player1][pSec], playeruserid);
                    
format(stringsizeof(string), "%s\n"ccwhite"Playing since "ccgreen"%d "ccwhite"hours, "ccgreen"%d "ccwhite"minutes, "ccgreen"%d "ccwhite"seconds ~ Wanted Level: "ccgreen"%d ",stringhms,GetPlayerWantedLevel(player1));
                    
format(stringsizeof(string), "%s\n"ccwhite"RegisteredDate: "ccgreen"%s "ccwhite"~ RegisteredTime: "ccgreen"%s "ccwhite"~ LastOnlineDate: "ccgreen"%s "ccwhite"~ LastOnlineTime: "ccgreen"%s",stringrdatertimelodatelotime);
                    
ShowPlayerDialog(playerid2343DIALOG_STYLE_MSGBOX"Player Status"string"OK""");
               }
               else {
                       
format(stringsizeof(string),"\t\t\t\t"ccorange"limitx Stats for %s (ID:%d)..."PlayerName2(player1), player1);
                    
format(stringsizeof(string), "%s\n\n"ccwhite"Kills: "ccgreen"%d"ccwhite", Deaths: "ccgreen"%d "ccwhite"--> Ratio of "ccgreen"%0.2f "ccwhite"kills per death, Admin kills: "ccgreen"%d",stringPlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeathsPlayerInfo[player1][AdminKills]);
                    
format(stringsizeof(string), "%s\n"ccwhite"limitx Status: "ccgreen"%s"ccwhite", TP Status: "ccgreen"%s"ccwhite", Skin: "ccgreen"%d"ccwhite", Maths Quiz won: "ccgreen"%d",stringrankdonrankdon2GetPlayerSkin(player1),PlayerInfo[player1][ReactionTestWon]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Cookies: "ccgreen"%d"ccwhite", Cakes: "ccgreen"%d"ccwhite", Biscuits: "ccgreen"%d"ccwhite", Ice Creames: "ccgreen"%d"ccwhite", Race Won: "ccgreen"%d",stringPlayerInfo[player1][Cookies],PlayerInfo[player1][Cakes],PlayerInfo[player1][Biscuits],PlayerInfo[player1][IceCreams], PlayerInfo[player1][RaceWon]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Money/Cash: "ccgreen"$%d "ccwhite"~ Banked Money/Cash: "ccgreen"$%d"ccwhite", Total Commands Used: "ccgreen"%d"ccwhite", Total Complaints: "ccgreen"%d",stringGetPlayerMoney(player1),PlayerInfo[player1][bank],PlayerInfo[player1][Totcmdsused],PlayerInfo[player1][pReports]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Total Logins: "ccgreen"%d"ccwhite", Total Kicks: "ccgreen"%d"ccwhite", Total Bans: "ccgreen"%d"ccwhite", Total Warnings: "ccgreen"%d, %s",stringPlayerInfo[player1][Totallogins],PlayerInfo[player1][Totalkicks], PlayerInfo[player1][Totalbans], PlayerInfo[player1][Totalwarnings], lvlstring);
                    
format(stringsizeof(string), "%s\n"ccwhite"Played "ccgreen"%d "ccwhite"hours, "ccgreen"%d "ccwhite"minutes, "ccgreen"%d "ccwhite"seconds",stringPlayerInfo[player1][pHour],PlayerInfo[player1][pMin], PlayerInfo[player1][pSec]);
                    
format(stringsizeof(string), "%s\n"ccwhite"Playing since "ccgreen"%d "ccwhite"hours, "ccgreen"%d "ccwhite"minutes, "ccgreen"%d "ccwhite"seconds ~ Wanted Level: "ccgreen"%d ",stringhms,GetPlayerWantedLevel(player1));
                    
format(stringsizeof(string), "%s\n"ccred_"Player account is not registered.",string);
                    
ShowPlayerDialog(playerid2343DIALOG_STYLE_MSGBOX"Player Status"string"OK""");}
               return 
mysql_free_result();
    } else return 
SendClientMessage(playeridred"Player Not Connected!");}
#endif 
Reply
#5

Are you running an older version of the MySQL? because I am not much experienced in MySQL but the code seems to be showing that the gamemode is running an older version. Correct me if I am wrong.
Reply
#6

I use the new Mysql version.
Reply
#7

MySQL version? don't lie because it won't help you.
Reply
#8

I don't lie + if you don't help i don't care.
Reply
#9

Which version should i use because my friend who gived me plugins and said its the new plugins
Reply
#10

Quote:
Originally Posted by Loinal
Посмотреть сообщение
I don't lie + if you don't help i don't care.
Quote:
Originally Posted by Loinal
Посмотреть сообщение
Which version should i use because my friend who gived me plugins and said its the new plugins
I want to help you that's why I am asking, because some people lie just because they feel shameful if they use older version of plugins as they will get insulted. There is a edit button for a reason, use it and ask your friend to solve the problem for you as he gave you the plugins, because you should know which version are you using... what a shame, how can you think we can guess or know your MySQL version?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)