Error @ OnPlayerText crashing server
#1

I typed a long line of text on the chat and it crashed the server.


PHP код:
[01:19:02] [debugAMX backtrace:
[
01:19:02] [debug#0 0000006d in ?? (... <8 arguments>) at <unknown file>:0
[01:19:02] [debug#1 0000006d in public OnPlayerText () at <unknown file>:0 
PHP код:
public OnPlayerText(playeridtext[])
{
    if (!
PlayerData[playerid][pLogged] || !PlayerData[playerid][pCharacter] || PlayerData[playerid][pTutorial] > || PlayerData[playerid][pTutorialStage] > || PlayerData[playerid][pHospital] != -1)
        return 
false;
    if (
PlayerData[playerid][pNewsGuest] != INVALID_PLAYER_ID && GetFactionType(PlayerData[playerid][pNewsGuest]) == FACTION_NEWS//&& IsPlayerInAnyVehicle(playerid) && IsNewsVehicle(GetPlayerVehicleID(playerid)))
    
{
        foreach (new 
Player) if (!PlayerData[i][pDisableBC]) {
              
SendClientMessageEx(iCOLOR_LIGHTGREEN"[NEWS] Guest %s: %s"ReturnName(playerid0), text);
        }
           return 
false;
       }
    else
    {
        new
            
targetid PlayerData[playerid][pCallLine],
            
string[200];
           new 
text1[128],
            
text2[128],
            
bubble[200];
        
strmid(text2text90128);
        
strmid(text1text090);
        if (!
IsPlayerOnPhone(playerid))
        {
             if(
strlen(text) > 90)
            {
                if (
IsPlayerInAnyVehicle(playerid) && IsWindowedVehicle(GetPlayerVehicleID(playerid)) && !CoreVehicles[GetPlayerVehicleID(playerid)][vehWindowsDown])
                {
                    
format(stringsizeof(string), "(vehicle) %s says: %s..."ReturnName(playerid0), text1);
                    
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                    
format(stringsizeof(string), "..%s"ReturnName(playerid0), text2);
                    
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                     
//SetPlayerChatBubble(playerid, string, COLOR_WHITE, 50, 5000);
                
}
                else
                {
                    if (!
PlayerData[playerid][pInjured] && !PlayerData[playerid][pLoopAnim])
                    {
                        switch (
random(6))
                        {
                            case 
0ApplyAnimation(playerid"GANGS""prtial_gngtlkA"4.10111strlen(text) * 1001);
                            case 
1ApplyAnimation(playerid"GANGS""prtial_gngtlkB"4.10111strlen(text) * 1001);
                            case 
2ApplyAnimation(playerid"GANGS""prtial_gngtlkE"4.10111strlen(text) * 1001);
                            case 
3ApplyAnimation(playerid"GANGS""prtial_gngtlkF"4.10111strlen(text) * 1001);
                            case 
4ApplyAnimation(playerid"GANGS""prtial_gngtlkG"4.10111strlen(text) * 1001);
                            case 
5ApplyAnimation(playerid"GANGS""prtial_gngtlkH"4.10111strlen(text) * 1001);
                        }
                        
SetTimerEx("StopChatting"strlen(text) * 100false"d"playerid);
                    }
                    
format(string128"%s says: %s..."ReturnName(playerid0), text1);
                    
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                    
format(string128"..%s"text2);
                    
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                    
//SetPlayerChatBubble(playerid, string, COLOR_WHITE, 50, 5000);
                
}
                return 
false;
            }
            else
            {
                if (
IsPlayerInAnyVehicle(playerid) && IsWindowedVehicle(GetPlayerVehicleID(playerid)) && !CoreVehicles[GetPlayerVehicleID(playerid)][vehWindowsDown])
                {
                    
format(stringsizeof(string), "(vehicle) %s says: %s"ReturnName(playerid0), text);
                    
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                    
format(bubblesizeof(bubble), "(vehicle) %s"text);
                     
SetPlayerChatBubble(playeridbubbleCOLOR_WHITE505000);
                }
                else
                {
                    if (!
PlayerData[playerid][pInjured] && !PlayerData[playerid][pLoopAnim])
                    {
                        switch (
random(6))
                        {
                            case 
0ApplyAnimation(playerid"GANGS""prtial_gngtlkA"4.10111strlen(text) * 1001);
                            case 
1ApplyAnimation(playerid"GANGS""prtial_gngtlkB"4.10111strlen(text) * 1001);
                            case 
2ApplyAnimation(playerid"GANGS""prtial_gngtlkE"4.10111strlen(text) * 1001);
                            case 
3ApplyAnimation(playerid"GANGS""prtial_gngtlkF"4.10111strlen(text) * 1001);
                            case 
4ApplyAnimation(playerid"GANGS""prtial_gngtlkG"4.10111strlen(text) * 1001);
                            case 
5ApplyAnimation(playerid"GANGS""prtial_gngtlkH"4.10111strlen(text) * 1001);
                        }
                        
SetTimerEx("StopChatting"strlen(text) * 100false"d"playerid);
                    }
                     
format(stringsizeof string"%s says: %s"ReturnName(playerid0), text);
                     
ProxDetector(25.0playeridstringCOLOR_FADE1COLOR_FADE2COLOR_FADE3COLOR_FADE4COLOR_FADE5);
                      
format(bubblesizeof(bubble), "%s"text);
                     
SetPlayerChatBubble(playeridbubbleCOLOR_WHITE505000);
                }
                 return 
false;
            }
        } 
What seems to be the problem here?
Reply


Messages In This Thread
Error @ OnPlayerText crashing server - by Uberanwar - 06.07.2018, 17:28
Re: Error @ OnPlayerText crashing server - by coool - 06.07.2018, 17:48
Re: Error @ OnPlayerText crashing server - by Uberanwar - 06.07.2018, 18:00
Re: Error @ OnPlayerText crashing server - by Verc - 06.07.2018, 18:50
Re: Error @ OnPlayerText crashing server - by CodeStyle175 - 06.07.2018, 18:58

Forum Jump:


Users browsing this thread: 3 Guest(s)