Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum pInfo
- {
- pPass,
- pNovacDzep,
- pGold, // Zlato
- pAdmin,
- ...
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- public OnPlayerConnect(playerid);
- {
- PlayerInfo[playerid][pGold] = 0;
- return 1;
- }
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("NovacDzep",PlayerInfo[playerid][pNovacDzep]);
- INI_Int("Gold",PlayerInfo[playerid][pGold]); //ZLATO
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- ...
- return 1;
- }
- stock SavePlayer(playerid)
- {
- if(UlogovanProvera[playerid] == 1)
- {
- new INI:File = INI_Open(Korisnici(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"NovacDzep",PlayerInfo[playerid][pNovacDzep]);
- INI_WriteInt(File,"Gold",PlayerInfo[playerid][pGold]); //ZLATO
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- ...
- INI_Close(File);
- }
- return 1;
- }
- ////////////////////////KOMANDE///////////////////
- CMD:kupizlato(playerid, params[], help)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, -2189.1714,-2275.5530,30.6250)) return SendClientMessage(playerid,-1, "Nisi u zlatari");
- {
- PlayerInfo[playerid][pGold] += 1;
- GivePlayerMoney(playerid, -950);
- }
- return 1;
- }
- CMD:prodajzlato(playerid, params[], help)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, -2189.1714,-2275.5530,30.6250)) return SendClientMessage(playerid,-1, "Nisi u zlatari");
- {
- if(PlayerInfo[playerid][pGold] < 1) return SendClientMessage(playerid,-1, "Nemas dovoljno zlata kod sebe!");
- PlayerInfo[playerid][pGold] -= 1;
- GivePlayerMoney(playerid, 800);
- SendClientMessage(playerid, -1, "Prodali ste gram zlata za 800 $");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement