Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*DCoins Sistema de Grana Secundaria.
- #Precisa da Include DOF2 Favor Adicionala ao seu Gamemode .
- Death_GM © 2014*/
- #if defined _DCoins_included
- #endinput
- #endif
- #define _DCoins_included
- #if ( !defined pasta )
- #error local para Guardadar Dados não definido , exemple: #define pasta "local"
- #endif
- new Float:cents[MAX_PLAYERS];
- new reals[MAX_PLAYERS];
- stock SetPlayerReals(playerid, coins) return reals[playerid] = coins;
- stock GivePlayerReals(playerid, coins) return reals[playerid] += coins;
- stock ResetPlayerReals(playerid) return reals[playerid] = 0;
- stock GetPlayerReals(playerid) return reals[playerid];
- stock Float:GetPlayerCents(playerid) return cents[playerid];
- stock Float:SetPlayerCents(playerid, Float:coins) return cents[playerid] = coins;
- stock Float:GivePlayerCents(playerid, Float:coins) return cents[playerid] += coins;
- stock Float:ResetPlayerCents(playerid) return cents[playerid] = 0.00000;
- stock SaveCoins(playerid) {
- new stt[128], nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
- format(stt, sizeof stt, "%s/%s.ini", pasta, nome);
- DOF2_SetFloat(stt, "Cents", cents[playerid]);
- DOF2_SetInt(stt, "Reals", reals[playerid]);
- DOF2_SaveFile();
- return 1;
- }
- stock LoadCoins(playerid) {
- new stt[128], nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
- format(stt, sizeof stt, "%s/%s.ini", pasta, nome);
- if(!DOF2_FileExists(stt))
- DOF2_CreateFile(stt);
- else {
- new emsm;
- new Float:nemsm;
- nemsm = DOF2_GetFloat(stt, "Cents");
- emsm = DOF2_GetInt(stt, "Reals");
- cents[playerid] = nemsm;
- reals[playerid] = emsm;
- return 1;
- }
- DOF2_SetFloat(stt, "Cents", 0.00000);
- DOF2_SetInt(stt, "Reals", 0);
- DOF2_SaveFile();
- cents[playerid] = 0;
- reals[playerid] = 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment