New MySQL Errors for old mysql
#4

Here i fixed it for you

PHP код:
forward public OnPlayerLogin(playerid);
public 
OnPlayerLogin(playerid)
{
    new 
found 0;
    new 
pName[24], str[256];
    
SetPVarInt(playerid"Admin"cache_get_value_int(0"Admin"));
    
SetPVarInt(playerid"PassedRPTest"cache_get_value_int(0"PassedRPTest"));
    
SetPVarInt(playerid"CharacterMade"cache_get_value_int(0"CharacterMade"));
    
SetPVarInt(playerid"AppMade"cache_get_value_int(0"AppMade"));
    
PlayerInfo[playerid][LoggedIn] = true;
    new 
fetch[256];
       
cache_get_field_name(0"AdminName"fetch);
    
format(PlayerInfo[playerid][AdminName], 256fetch);
    for(new 
1MAX_APPLICATIONSi++)
    {
        if(
ApplicationInfo[i][SentIn] == 1)
        {
            
found++;
        }
    }
    if(
GetPVarInt(playerid"Admin") >= || IsPlayerAdmin(playerid))
    {
        if(
found 0)
        {
            
format(strsizeof(str), "Server: There are currently (%d) applications waiting approval. (/applications)"found);
            
SendClientMessage(playeridCOLOR_ORANGEstr);
        }
    }
    if(
GetPVarInt(playerid"CharacterMade") == 0)
    {
        if(
GetPVarInt(playerid"PassedRPTest") == 0)
        {
            if(
GetPVarInt(playerid"AppMade") == 1) {
                
SendClientMessage(playeridCOLOR_ORANGE"Server: It looks like you have already done an application to join our server.");
                
SendClientMessage(playeridCOLOR_ORANGE"We are sorry it's taking so long for you to be reviewed, Please have patients, Thanks.");
                
SendClientMessage(playeridCOLOR_ORANGE"Would you like to take a multi-choice test?");
                
ShowPlayerDialog(playeridTakeMultiChoiceDIALOG_STYLE_MSGBOX"Take a different test?""Would you like to take the multiple choice test?""Yes""No");
                
PlayerInfo[playerid][AppID] = cache_get_value_int(0"AppID");
                
ApplicationInfo[PlayerInfo[playerid][AppID]][PlayerID] = playerid;
            }
            if(
GetPVarInt(playerid"AppMade") == 0) {
                
AdminsOnline(playerid);
                
SetPVarInt(playerid"Questions"1);
            }
            
SetSpawnInfo(playerid03051494.85891306.481093.2953269.1500000);
            
SetPlayerInterior(playerid,3);
            
SetPlayerVirtualWorld(playeridplayerid+1);
            
SpawnPlayer(playerid);
            
SetPlayerSkin(playerid305);
            
TogglePlayerSpectating(playerid0);
            
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
            return 
1;
        }
        else {
            
SendClientMessage(playeridCOLOR_ORANGE"Server: Logged in, please make your character.");
            
SetSpawnInfo(playerid03051494.85891306.481093.2953269.1500000);
            
SetPlayerInterior(playerid,3);
            
SetPlayerVirtualWorld(playeridplayerid+1);
            
SpawnPlayer(playerid);
            
SetPlayerSkin(playerid305);
            
ShowCreateCharacterMenu(playerid);
            
TogglePlayerSpectating(playerid0);
            
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
            return 
1;
        }
    }
    
SetPVarInt(playerid"Skin"cache_get_value_int(0"Skin"));
    
SetPVarInt(playerid"Sex"cache_get_value_int(0"Sex"));
    
SetPVarInt(playerid"Age"cache_get_value_int(0"Age"));
    
SetPVarInt(playerid"Cash"cache_get_value_int(0"Cash"));
    
SetPVarInt(playerid"Bank"cache_get_value_int(0"Bank"));
    
SetPVarInt(playerid"Interior"cache_get_value_int(0"Interior"));
    
SetPVarInt(playerid"VirtualWorld"cache_get_value_int(0"VirtualWorld"));
    
SetPVarFloat(playerid"PosX"cache_get_value_float(0"PosX"));
    
SetPVarFloat(playerid"PosY"cache_get_value_float(0"PosY"));
    
SetPVarFloat(playerid"PosZ"cache_get_value_float(0"PosZ"));
    
SetPVarFloat(playerid"PosA"cache_get_value_float(0"PosA"));
    
GetPlayerName(playeridpName24);
    
GiveNameSpace(pName);
    
format(strsizeof(str), "Server: Welcome back %s, Thank you for being part of the community."pName);
    
SendClientMessage(playeridCOLOR_ORANGEstr);
    
SetSpawnInfo(playerid0GetPVarInt(playerid"Skin"), GetPVarFloat(playerid"PosX"), GetPVarFloat(playerid"PosY"), GetPVarFloat(playerid"PosZ"), GetPVarFloat(playerid"PosA"), 00000);
     
SetPlayerInterior(playeridGetPVarInt(playerid"Interior"));
      
SetPlayerVirtualWorld(playeridGetPVarInt(playerid"VirtualWorld"));
       
SpawnPlayer(playerid);
       
SetCameraBehindPlayer(playerid);
       
SetPlayerSkin(playeridGetPVarInt(playerid"Skin"));
       
PlayerInfo[playerid][AppID] = -1;
       
TogglePlayerSpectating(playerid0);
       
TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
       
SetPlayerMoneyEx(playeridGetPVarInt(playerid"Cash"));
    return 
1;

Next time, if you want to try to migrate from old mysql to new mysql, read the wiki first.
https://sampwiki.blast.hk/wiki/MySQL/R40
Reply


Messages In This Thread
New MySQL Errors for old mysql - by TheLeech - 17.01.2019, 12:45
Re: New MySQL Errors for old mysql - by DarkMythHunter - 17.01.2019, 12:50
Re: New MySQL Errors for old mysql - by TheLeech - 17.01.2019, 13:18
Re: New MySQL Errors for old mysql - by B3x7K - 17.01.2019, 13:27
Re: New MySQL Errors for old mysql - by TheLeech - 17.01.2019, 13:37
Re: New MySQL Errors for old mysql - by B3x7K - 17.01.2019, 14:28
Re: New MySQL Errors for old mysql - by TheLeech - 17.01.2019, 14:34
Re: New MySQL Errors for old mysql - by B3x7K - 17.01.2019, 15:05
Re: New MySQL Errors for old mysql - by TheLeech - 17.01.2019, 15:28

Forum Jump:


Users browsing this thread: 1 Guest(s)