Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum E_PLAYER_DATA {
- p_xp
- }
- public OnGameModeInit()
- {
- SetTimer("XP", 60000, true);
- }
- public OnPlayerConnect(playerid)
- {
- new ORM: ormid = P[playerid][_p_ormid] = orm_create("accounts");
- orm_addvar_int(ormid, P[playerid][p_xp], "Xp");
- orm_setkey(ormid, "Name");
- orm_select(ormid, "OnMySQL_SelectAccount", "d", playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerScore(playerid, P[playerid][p_xp]);
- }
- forward XP();
- public XP()
- {
- for ( new i = 0; i <= GetPlayerPoolSize(); i ++ )
- {
- if ( !IsPlayerConnected( i ) )
- continue;
- SetPlayerScore( i, GetPlayerScore( i ) + 1);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement