Avoiding bug
#1

1.) How could I avoid the GMX bug? It automatically forces players to spawn in blueberry(0.0,0.0,0.0) with the CJ skin. How could I avoid this?











2.) Is it possible to make the Class selection have custom stuff? Such as if I have skin 29 when i log out, when i login, it has that skin and when you click spawn it spawns you at your last pos? Since there isn't a playerid thing for ongamdemodeinit I wasn't sure if this is possible.
Reply
#2

1. there can be many reasons... post your OnPlayerSpawn code.

2. yes, its possible. if you save player stats on a file.
Reply
#3

Quote:
Originally Posted by jamesbond007
Посмотреть сообщение
1. there can be many reasons... post your OnPlayerSpawn code.

2. yes, its possible. if you save player stats on a file.
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(User[playerid][pX] == 0.0 && User[playerid][pY] == 0)
    {
        SetPlayerPos(playerid, 1488.9740, -1720.1028, 8.2370);
        SetPlayerInterior(playerid, 0);
    }
   
    return 1;
}

For 2, how could you do it if there is no playerid in ongamemodeinit
Reply
#4

BUMP
Reply
#5

1) i can't help on that

but perhaps on 2

2)

first you must enum the player data first, which will save the skin number to be use next time you'll login

pawn Код:
enum pInfo
{
    pSkin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
next

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    return 1;
}
and if you have any /setskin command don't forget to add this at the very end of the line of the command, which will save the skin to your player data(user)

pawn Код:
PlayerInfo[playerid][pSkin] = skin;
and about the last pos, i may tell you later, cuz im too sleepy , just PM tomorrow

hope that will help you :yawning:
Reply
#6

Quote:
Originally Posted by BlackID
Посмотреть сообщение
1) i can't help on that

but perhaps on 2

2)

first you must enum the player data first, which will save the skin number to be use next time you'll login

[pawn]enum pInfo
{
pPass,
pLevel,
pLogged,
pCash,
pScore,
pMute,
pDeaths,
pSkin,
pKills,
pBanned,
pFrozen,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
I have my enums. The main question is how could I make the addplayerclass with their stats such as:

AddPlayerClass(User[playerid][Skin], User[playerid][pX], etc.....
Reply
#7

you mean like this?

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
    SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)