SA-MP Forums Archive
MDC is crashing - 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: MDC is crashing (/showthread.php?tid=601696)



MDC is crashing - lulo356 - 24.02.2016

I've created this this command to check the players MDC, but after using it the server is crashing, Thanks for your advise

PHP код:
ShowMDC(playeridName[])
{
    new 
Data[150],Field[258],idxiUsername[255], iAgeiSuspect[255];
    
mysql_queryF("SELECT * FROM `Accounts` WHERE `Username` = '%s' LIMIT 1"Name);
    
mysql_store_result();
    if(
mysql_num_rows() == 1){
        
mysql_fetch_rowEx(Data);
        
Field strtukDataidx'|' );
          for(new 
020s++)
        {
            switch(
s)
            {
                case 
1strmid(iUsername,Field,0,strlen(Field),255);
                case 
11iAge strval(Field);
                case 
20strmid(iSuspect,Field,0,strlen(Field),255);
            }
            
Field strtukDataidx'|' );
        }
        
mysql_free_result();
        new 
string[128], string1[258];
            
        
format(string1sizeof(string1),"Police Mobile Database Computer: Name: %s | Age %d | Gender (coming)",iUsernameiAge );
        
SendClientMessage(playeridORANGEstring1);
            
        
format(stringsizeof(string), "Arrests(coming) | Wanted(coming)| Suspect:%s | Phone number:(coming)",iSuspect);
        
SendClientMessage(playeridWHITEstring);
        }
        else
        {
            
SendClientMessage(playeridRED"This account doesn't exist");
    }
    return 
1;

PHP код:
command(mdcplayeridparams[])
{
    new 
Name[119];
    if(
sscanf(params"s"Name))
    {
        if(
Factions[Player[playerid][Faction]][CommandTypes] == || Factions[Player[playerid][Faction]][CommandTypes] == 3)
        {
            
SendClientMessage(playeridWHITE"SYNTAX: /mdc [Username]");
        }
        else
        {
            
RemoveTextMessage(playerid);
            
TextDrawShowForPlayer(playeridText:CantCommand);
            
SetTimerEx("RemoveTextMessage"3500false"d"playerid);
        }
    }
    else
    {
        if(
Factions[Player[playerid][Faction]][CommandTypes] == || Factions[Player[playerid][Faction]][CommandTypes] == 3)
        {
            
format(Name,sizeof(Name),"%s"Name);
            
ShowMDC(playeridName);
        }
        else
        {
            
RemoveTextMessage(playerid);
            
TextDrawShowForPlayer(playeridText:CantCommand);
            
SetTimerEx("RemoveTextMessage"3500false"d"playerid);
        }
    }
    return 
1;




Re: MDC is crashing - alexanderjb918 - 24.02.2016

Server log?


Re: MDC is crashing - lulo356 - 24.02.2016

Quote:
Originally Posted by alexanderjb918
Посмотреть сообщение
Server log?
Doesn't give any warning/fails


Re: MDC is crashing - lulo356 - 25.02.2016

Quote:
Originally Posted by lulo356
Посмотреть сообщение
Doesn't give any warning/fails
PHP код:
mysql_fetch_rowEx(Data); 
this is the problm