Script not responding
#7

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
Show the code that executes after logging in. As well as OnPlayerRequestSpawn/OnPlayerRequestClass.

Have you confirmed that your "script stopped responding" (in other words, your server; which can be the case of an infinite loop somewhere) or if it's merely an issue with the process of logging in and spawning (where the server isn't actually frozen or anything of the sort)?
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
/*    SetPlayerPos(playerid,2182.4800,1285.8407,42.9785);
    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
    TogglePlayerSpectating(playerid, true);
    TextDrawShowForPlayer(playerid, Textdraws[0]);
    TextDrawShowForPlayer(playerid, Textdraws[1]);
    TextDrawShowForPlayer(playerid, Textdraws[2]);
    TextDrawShowForPlayer(playerid, Textdraws[3]);
    SelectTextDraw(playerid, 0xA3B4C5FF);
*/
    
SetPlayerTeamFromClass(playeridclassid);
    return 
1;
}
// for the comments above, i used them when i had built a custom class selection system but its now removed. 
PHP код:
function SetPlayerTeamFromClass(playeridclassid)
{
    switch(
classid)
    {
        case 
.. 2:
        {
            
GameTextForPlayer(playerid,"~p~ Clans Man Gang",1000,3);
            
tInfo[playerid][Team] = TEAM_CLANSMAN;
        }
         case 
.. 5:
        {
            
GameTextForPlayer(playerid,"~y~ G-City",1000,3);
            
tInfo[playerid][Team] = TEAM_GCITY;
        }
           case 
.. 9:
        {
            
GameTextForPlayer(playerid,"~b~ Babilon",1000,3);
            
tInfo[playerid][Team] = TEAM_POLICE;
        }
          case 
10 .. 12:
        {
            
GameTextForPlayer(playerid,"~r~ VIP",1000,3);
            
tInfo[playerid][Team] = TEAM_VIP;
        }
    }
    
SetPlayerCameraPos(playerid2168.91701285.301847.4067);
    
SetPlayerCameraLookAt(playerid2169.91991285.352947.0267);
    
SetPlayerPos(playerid,2181.4541,1285.5052,42.8728);
    
SetPlayerFacingAngle(playerid89.9141);

PHP код:

//logging in the player here
function LoadAcc(playerid)
{
    
INI_ParseFile(IPPath(playerid), "LoadIPBan_%s", .bExtra true, .extra playerid);
    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
    
NameCheck(playerid);
    
AddAcc(playerid);
    if(
fexist(UserPath(playerid)))
    {
        if(!
strcmp(RPIP(playerid), pInfo[playerid][pIP]))
        {
            new 
yearmonthdayhourminssecstring[64];
            
getdate(yearmonthday);
            
gettime(hour,mins,sec);
            
format(string40,"%d/%d/%d at %d:%d:%d"day,month,year,hour,mins,sec);
            new 
INI:File INI_Open(UserPath(playerid));
            
INI_SetTag(File,"data");
            
INI_WriteString(File,"LastOn",string);
            
INI_Close(File);
             
BanCheck(playerid);
            if(
tInfo[playerid][ClearLog] == 0)
            {
                
SendClientMessage(playerid,COL_NOTIFY,"Your account has been automatically logged in.");
                if(
IsPlayerStaff(playerid))
                {
                      
SendServerMSG(COL_LIGHTGREY,"[CONNECTED]: %s(ID:%i) has joined the server. [%i/%i]"ReturnPlayerName(playerid),playerid,CountPlayers(),MAX_CUR_PLAYERS);
                    
SendClientMSG(playerid,COL_YELLOW,"You have been logged in as a level %i administrator. Welcome Back!!",pInfo[playerid][Admin]);
                }
                else
                {
                    foreach(new 
iPlayer)
                    {
                        if(
IsPlayerStaff(i))
                        {
                            
SendClientMSG(i,COL_LIGHTGREY,"[CONNECTED]: %s(ID:%i) has joined the server. (IP: %s) [%i/%i]"ReturnPlayerName(playerid),playerid,RPIP(playerid),CountPlayers(),MAX_CUR_PLAYERS);
                        }
                        else
                        {
                            
SendClientMSG(i,COL_LIGHTGREY,"[CONNECTED]: %s(ID:%i) has joined the server [%i/%i]"ReturnPlayerName(playerid),playerid,CountPlayers(),MAX_CUR_PLAYERS);
                        }
                    }
                }
                  
SendClientMessage(playerid,-1,"{F52C2C}=========================================================");
                
SendClientMSG(playerid,-1,"{F52C2C}[MOTD]:{D17777} %s",MOTDInfo[MOTDstr]);
                
SendClientMessage(playerid,-1,"{F52C2C}=========================================================");
                if(
pInfo[playerid][Email] == 0)
                {
                    
SendClientMessage(playerid,COL_NOTIFY,"Your account doesn't have an assigned Email Address. Use /assignemail to link one to this account.");
                    
SendClientMessage(playerid,COL_NOTIFY,"This Email Address will only be used for account recovery purposes ONLY.");
                }
                
HideWelcomeTXD(playerid);
                
ShowPlayerTextdraws(playerid);
                
SetPlayerScore(playeridpInfo[playerid][Score]);
               }
        }
        else
          {
            
InterpolateCameraPos(playerid1177.1447751243.40600549.8457832170.2109371284.39721644.55846745000);
            
InterpolateCameraLookAt(playerid1182.1140131243.84277350.1861452175.1882321284.80187944.30857445000);
            new 
dialog[180];
            new 
string[400];
            
strcat(string""COL_WHITE" Welcome back "COL_GREEN""SERVER_NAME""COL_WHITE". This account is registered, please input your password below.\n\n");
             
format(dialogsizeof(dialog), ""COL_WHITE"Account Name: "COL_GREEN"%s (ID:%i)\n ",ReturnPlayerName(playerid),playerid);
            
strcat(string,dialog);
             
format(dialogsizeof(dialog),""COL_WHITE"IP Address: "COL_GREEN"%s\n\n ",RPIP(playerid));
            
strcat(string,dialog);
            
strcat(string""COL_WHITE" **Remember to read "COL_RED"/rules "COL_WHITE".\n");
            
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE""SERVER_NAME" - Login",string,"Login","X");
           }
    }
    else
    {
        
InterpolateCameraPos(playerid1177.1447751243.40600549.8457832170.2109371284.39721644.55846745000);
        
InterpolateCameraLookAt(playerid1182.1140131243.84277350.1861452175.1882321284.80187944.30857445000);
        new 
dialog[180];
        new 
string[400];
        
strcat(string""COL_WHITE" Welcome to "COL_GREEN""SERVER_NAME""COL_WHITE". This account is not registered, please input your desired password below\n");
        
strcat(string""COL_WHITE" to register this account.\n\n");
         
format(dialogsizeof(dialog), ""COL_WHITE"Account Name: "COL_GREEN"%s (ID:%i)\n ",ReturnPlayerName(playerid),playerid);
        
strcat(string,dialog);
        
format(dialogsizeof(dialog),""COL_WHITE"IP Address:"COL_GREEN" %s\n\n ",RPIP(playerid));
        
strcat(string,dialog);
        
strcat(string""COL_WHITE" **Do "COL_RED"NOT "COL_WHITE"share your password with anyone. Not even administrators.\n");
         
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,""COL_WHITE""SERVER_NAME" - Registration",string,"Register","X");
    }
    return 
1;

Reply


Messages In This Thread
Script not responding - by Leaky - 11.11.2018, 01:50
Re: Script not responding - by Leaky - 11.11.2018, 21:23
Re: Script not responding - by CJ101 - 11.11.2018, 21:29
Re: Script not responding - by Leaky - 11.11.2018, 23:03
Re: Script not responding - by Leaky - 20.11.2018, 05:49
Re: Script not responding - by CantBeJohn - 20.11.2018, 09:15
Re: Script not responding - by Leaky - 24.11.2018, 04:50

Forum Jump:


Users browsing this thread: 4 Guest(s)