[Ajuda] Skin
#8

Precisa melhorar bastante coisa nisso.

PHP код:
// Sua variavel
enum pData
{
    
ORM:OrmID,
    
// outros dados
    
pNome[24],
    
pTimerPlayer,
    
pSkin
}
new 
Player[MAX_PLAYERS][pData];
// Sua funзгo
loadPlayer(playerid)  
{
    new 
ORM:ormid Player[playerid][OrmID] = orm_create("suatabela"conexao_mysql);
    
// Outros que tiverem vocк pхe tambйm
    
orm_addvar_int(ormidPlayer[playerid][pSkin], "Skin"); 
    
orm_addvar_string(ormidPlayer[playerid][pNome], 24"Nome"); // nickname
    
orm_setkey(ormid24"Nome");
    
orm_select(ormid"OnPlayerLogin""d"playerid); 
}
// Salvamento de conta
savePlayer(playerid) return orm_update(Player[playerid][OrmID]);
// Quando conectar
public OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridPlayer[playerid][pNome], 24);
    
loadPlayer(playerid);
    
Player[playerid][pTimerPlayer] = SetTimerEx("OnPlayerUpdateEx"1000true"i"playerid);
}
// Parвmetros para recebimento de informaзхes / login
forward OnPlayerLogin(playerid);
public 
OnPlayerLogin(playerid
{
    if(
orm_errno(PlayerInfo[playerid][OrmID]) == ERROR_OK) { // jogador tem registro no banco de dados
        
SetSpawnInfo(playerid0Player[playerid][pSkin], 1958.37831343.157215.3746269.1425000000); 
        
SendClientMessage(playerid0x00FF00FF"Vocк estб registrado!");
    } else { 
// Jogador nгo possui registro no banco de dados
        
SendClientMessage(playerid0xFFFF00FF"Vocк nгo estб registrado!");
        
SetSpawnInfo(playerid0random(311), 1958.37831343.157215.3746269.1425000000);
    }
    return 
1;

Use como exemplo isto.
Reply


Messages In This Thread
Skin - by BuDweiSeR - 09.03.2018, 12:33
Re: Skin - by GuiKommander - 09.03.2018, 12:43
Re: Skin - by BuDweiSeR - 09.03.2018, 13:37
Re: Skin - by Locky_ - 09.03.2018, 13:53
Re: Skin - by BuDweiSeR - 09.03.2018, 15:35
Re: Skin - by Locky_ - 09.03.2018, 15:37
Re: Skin - by BuDweiSeR - 09.03.2018, 18:52
Re: Skin - by Locky_ - 09.03.2018, 19:28
Re: Skin - by Felipealves - 11.03.2018, 04:05
Re: Skin - by Marllun - 11.03.2018, 04:07

Forum Jump:


Users browsing this thread: 1 Guest(s)