18.12.2017, 06:20
(
Last edited by zMorningStar; 20/12/2017 at 04:33 PM.
)
Gostaria de ajuda para saber como salvar o EXP de 1 а 4 do player com o banco de dados MySQL.
Este й o meu cуdigo:
Crйditos para o Sistema de XP + Level do JPedro:
https://sampforum.blast.hk/showthread.php?tid=580508
Este й o meu cуdigo:
PHP Code:
// EXP
new EXP[ MAX_PLAYERS ];
public OnPlayerConnect( playerid )
{
SetTimerEx( "UpPlayer", 600000, true, "i", playerid );
}
// UpPlayer
forward UpPlayer( playerid );
public UpPlayer( playerid )
{
new strEXP[ 128 ],
strLevel[ 128 ];
EXP[ playerid ]++;
if( EXP[ playerid ] == 4 )
{
new Level = GetPlayerScore( playerid );
SetPlayerScore( playerid, Level+1 );
EXP[ playerid ] = 0;
format( strEXP, sizeof( strEXP ), "| UP EXP | Vocк ganhou +1 Ponto de Experiкncia {FFFFFF}[ 4 {33AA33}/ {FFFFFF}4 ]{33AA33}.", EXP[ playerid ] );
SendClientMessage( playerid, COLOR_VERDEESCURO, strEXP );
format( strLevel, sizeof( strLevel ), "| LEVEL UP | Vocк juntou 4 Pontos de Experiкncia e upou para o level {FFFFFF}[ %i ]{33AA33}.", ++Level );
SendClientMessage( playerid, COLOR_VERDEESCURO, strLevel );
PlayerInfo[ playerid ][ pLevel ]++;
PlayerPlaySound( playerid, 1149, 0.0, 0.0, 0.0 );
GameTextForPlayer( playerid, "+UP!", 7000, 6 );
return 0;
}
format( strEXP, sizeof( strEXP ), "| UP EXP | Vocк ganhou +1 Ponto de Experiкncia {FFFFFF}[ %i {33AA33}/ {FFFFFF}4 ]{33AA33}.", EXP[ playerid ] );
SendClientMessage( playerid, COLOR_VERDEESCURO, strEXP );
PlayerPlaySound( playerid, 1139, 0.0, 0.0, 0.0 );
GameTextForPlayer( playerid, "+EXP!", 7000, 6 );
return 1;
}
https://sampforum.blast.hk/showthread.php?tid=580508