Won't spawn player correctly.
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_LOGIN)
    {
        if(response == 0)
        {
            Kick(playerid);
        }
        else
        {
            new query[300], password[128];
            format(query, sizeof(query), "SELECT `Password` FROM `Accounts` WHERE id = %d", PlayerSQLID[playerid]);
            mysql_query(query);
            mysql_store_result();
            mysql_fetch_row(password);
            mysql_free_result();
           
            if(strcmp(password, inputtext, false) == 0)
            {
                PreloadAnimLib(playerid,"BOMBER");
                PreloadAnimLib(playerid,"RAPPING");
                PreloadAnimLib(playerid,"SHOP");
                PreloadAnimLib(playerid,"BEACH");
                PreloadAnimLib(playerid,"SMOKING");
                PreloadAnimLib(playerid,"ON_LOOKERS");
                PreloadAnimLib(playerid,"DEALER");
                PreloadAnimLib(playerid,"CRACK");
                PreloadAnimLib(playerid,"CARRY");
                PreloadAnimLib(playerid,"COP_AMBIENT");
                PreloadAnimLib(playerid,"PARK");
                PreloadAnimLib(playerid,"INT_HOUSE");
                PreloadAnimLib(playerid,"FOOD");
                PreloadAnimLib(playerid,"GANGS");
                PreloadAnimLib(playerid,"PED");
                PreloadAnimLib(playerid,"FAT");

                LoggedIn[playerid] = 1;
                PlayerBanned[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Banned", "Accounts");
                if(PlayerBanned[playerid] == 1)
                {
                    SendClientMessage(playerid, COLOUR_RED, "You are banned from this server.");
                    Kick(playerid);
                    return 1;
                }

                PlayerLevel[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Level", "Accounts");
                SetPlayerScore(playerid, PlayerLevel[playerid]);
               
                PlayerMoney[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Money", "Accounts");
                ResetPlayerMoney(playerid);
                GivePlayerMoney(playerid, PlayerMoney[playerid]);
               
                AdminLevel[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "AdminLevel", "Accounts");
               
                PlayerArmour[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Armour", "Accounts");
                SetPlayerArmour(playerid, PlayerArmour[playerid]);
               
                Faction[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Faction", "Accounts");
                FRank[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "FRank", "Accounts");
               
                SetSpawnInfo(playerid, -1, PlayerSkin[playerid], -227.3866, 1039.8873, 19.7422, 180.0, 0,0,0,0,0,0);
                SpawnPlayer(playerid);
                new string[256];
                format(string, sizeof(string), "Welcome to Bone County Roleplay %s : Level: %d Money: $ %d Admin Level: %d Faction: %s Faction Rank: %d", GetNameEx(playerid), PlayerLevel[playerid], PlayerMoney[playerid], AdminLevel[playerid], FactionName[Faction[playerid]], FRank[playerid]);
                SendClientMessage(playerid, 0xFFD99FFF, string);
               
            }
            else
            {
                new string[128];
                format(string, sizeof(string), "Welcome to %s\n\nYou entered a wrong password, please try again:", HOSTNAME);
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login Dialog", string, "Login", "Leave");
            }
        }
    }
Alright, It spawn's but then it appears to "Overwrite" the character with default setting's, i.e Skin 0, no weapons etc. Also. for a split second I see the skin, weapon and everything else, then it changes to 0.
Reply
#2

Can we have your OnPlayerSpawn code?
It might be there somewhere...
Reply
#3

pawn Код:
public OnPlayerSpawn(playerid)
{
    PlayerSkin[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "Skin", "Accounts");
    SetPlayerSkin(playerid, PlayerSkin[playerid]);
    ResetPlayerWeapons(playerid);
    new fieldname[50];
    for(new w = 0; w < 13; w++)
    {
        format(fieldname, sizeof(fieldname), "Weapon%d", w);
        PlayerWeapons[playerid][w] = MySQL_GetValue(PlayerSQLID[playerid], fieldname, "Accounts");
        format(fieldname, sizeof(fieldname), "Weapon%dAmmo", w);
        PlayerWeaponAmmo[playerid][w] = MySQL_GetValue(PlayerSQLID[playerid], fieldname, "Accounts");

        if(PlayerWeapons[playerid][w] > 0) GivePlayerWeapon(playerid, PlayerWeapons[playerid][w], PlayerWeaponAmmo[playerid][w]);
    }
    if(AdminJail[playerid] >= 1)
    {
        new string2[128];
        format(string2, sizeof(string2), "You have %d minutes left in Admin Jail.", AdminJail[playerid]);
        SendClientMessage(playerid, COLOUR_GREY, string2);

        SetPlayerPos(playerid, 264.58, 77.38, 1001.04);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, 0);
    }
    return 1;
}
Thanks.
, Also I know it does it again, but that was me testing to see if it would fix it, unsucessful.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)