cmd problem
#1

Код:
[21:59:20] [debug] AMX backtrace:
[12:28:00] [debug] Server crashed while executing xmania3.amx
[12:28:00] [debug] AMX backtrace:
[12:28:00] [debug] #0 0000006c in ?? (... <26 arguments>) at <unknown file>:0
[12:28:00] [debug] #1 0000006c in public cmd_auninviteoff () at <unknown file>:0
[12:28:00] [debug] #2 native CallLocalFunction () from samp03svr
[12:28:00] [debug] #3 00009adc in public OnPlayerCommandText (playerid=0, cmdtext[]=@0192c870 "/auninviteoff eclipse27 0 0") at D:\SAMP stuff\RPG Romania 1.00.40\pawno\include\zcmd.inc:108
PHP код:
CMD:auninviteoff(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
PlayerInfo[playerid][pAdmin] >= 4)
    {
        new 
idfp,sendername[25],string[MAX_STRING],reason[64],rank,ftime,faction,idd,query[500],string2[500];
        if(
sscanf(params"s[25]is[64]"idfpreason)) return SCM(playerid,COLOR_WHITE,"{FF9900}Scrie: {33CCFF}/auninviteoff <Name> <FPunish> <Reason>");
        
format(stringsizeof(string), "SELECT `Member` FROM `users` WHERE LOWER(name) = LOWER('%s') LIMIT 1"id);
        new 
Cachemysql_query SQLstring );
        if ( 
cache_get_row_count ( ) )
        {
            new 
fostfactiune cache_get_row_int 0);
            
cache_delete );
            if(
fostfactiune == 0)
            {
                
SendClientMessage(playeridCOLOR_WHITE"Acest jucator nu este intr-o factiune.");
                return 
1;
            }
            
format(querysizeof(query), "SELECT * FROM `users` WHERE `name`='%s'",id);
            new 
Cachemembresult mysql_query(SQLquery);
            for(new 
icache_get_row_count (); != j; ++i)
            {
                
idd cache_get_field_content_int(i"id");
                
rank cache_get_field_content_int(i"Rank");
                
ftime cache_get_field_content_int(i"FactionTime");
                
faction cache_get_field_content_int(i"id");
            }
            
cache_delete(membresult);
            if(
fp == 0)
            {
                   
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* L-ai dat pe %s afara din factiunea sa fara FP."id);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
mysql_format(SQL,string,sizeof(string),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FPunish`='0',`FWarn`='0',`FactionTime`='0',`ALeader`='0' WHERE `name`='%s'",id);
                
mysql_tquery(SQL,string,"","");
                
format(stringsizeof(string), "Ai fost demis de Admin %s din factiunea din care faceai parte %s (rank %d) dupa %d zile, fara FP. Motiv: %s.",sendername,NumeFactiune(PlayerInfo[id][pMember]),PlayerInfo[id][pRank],PlayerInfo[id][pFactionTime],reason);
                
mysql_format(SQLquerysizeof(query), "INSERT INTO `emails` (`playerid`,`Message`) VALUES('%d','%s')",PlayerInfo[id][pSQLID],string);
                   
mysql_tquery(SQL,query,"","");
                
format(string2sizeof(string2), "%s was uninvited by Admin %s from faction %s (rank %d) after %d days, without FP. Reason: %s.",id,sendername,DynamicFactions[faction][fName],rank,ftime,reason);
                
mysql_format(SQLquerysizeof(query), "INSERT INTO faction_logs (`text`,`player`,`leader`) VALUES ('%s','%d','%d')"string2iddPlayerInfo[playerid][pSQLID]);
                
mysql_tquery(SQL,query,"","");
            }
            else if(
fp >= 1)
            {
                   
GetPlayerName(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* L-ai dat pe %s afara din factiunea sa cu %d FP."id,fp);
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
mysql_format(SQL,string,sizeof(string),"UPDATE users SET `Team`='3',`Member`='0',`Leader`='0',`Rank`='0',`Model`='250',`FPunish`='%d',`FWarn`='0',`FactionTime`='0',`ALeader`='0' WHERE `name`='%s'",fp,id);
                
mysql_tquery(SQL,string,"","");
                
format(stringsizeof(string), "Ai fost demis de Admin %s din factiunea din care faceai parte %s (rank %d) dupa %d zile, cu %d FP. Motiv: %s.",sendername,NumeFactiune(PlayerInfo[id][pMember]),PlayerInfo[id][pRank],PlayerInfo[id][pFactionTime],fp,reason);
                
mysql_format(SQLquerysizeof(query), "INSERT INTO `emails` (`playerid`,`Message`) VALUES('%d','%s')",PlayerInfo[id][pSQLID],string);
                   
mysql_tquery(SQL,query,"","");
                
format(string2sizeof(string2), "%s was uninvited by Admin %s from faction %s (rank %d) after %d days, with %d FP. Reason: %s.",id,sendername,DynamicFactions[faction][fName],rank,ftime,fp,reason);
                
mysql_format(SQLquerysizeof(query), "INSERT INTO faction_logs (`text`,`player`,`leader`) VALUES ('%s','%d','%d')"string2iddPlayerInfo[playerid][pSQLID]);
                
mysql_tquery(SQL,query,"","");
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_WHITE"Acest jucator nu exista.");
            
cache_delete );
            return 
1;
        }
    }
    return 
1;

Reply
#2

bump
Reply
#3

maybe it's not main problem but,

new id,
if(sscanf(params, "s[25]is[64]", id,
format(query, sizeof(query), "SELECT * FROM `users` WHERE `name`='%s'",id);

id might be id[MAX_PLAYER_NAME] i think..?
Reply
#4

i fixed the problem , thank you alvtr for showing me one of my mistakes that shown me all my errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)