Jump to content

Question

1 answer to this question

Recommended Posts

  • 0
Posted (edited)
Acum 21 minute, Azze47 a spus:

As vrea si eu la 15 player on de ex sa le dea un mic bonus help me

#include a_samp
#include dc_cmd
#define IsPlayerTakeBonus(%0) PlayerBonus[%0]
new PlayerBonus[MAX_PLAYERS];

CMD:getbonus(playerid) {
    if(IsPlayerTakeBonus(playerid) == 1) return SendClientMessage(playerid, 0xFF0000FF, !"Ai luat deja bonus!");
    PlayerInfo[playerid][pMoney] = 10000; 
    return UpdatePlayerBonus(playerid); 
}  

public OnGameModeInit() {
    if(!fexist("bonus"))  ini_createFile("bonus");
    return 1;
}  


// Il bagi in orice loc al GM
stock UpdatePlayerBonus(playerid) {
    PlayerBonus[playerid] = !PlayerBonus[playerid]; 
    
    new sendername[MAX_PLAYER_NAME+1]; 
    GetPlayerName(playerid, sendername, sizeof(sendername)); 
    
    new BonusFile = ini_openFile("bonus");
    ini_setInteger(BonusFile, sendername, PlayerBonus[playerid]); 
    ini_closeFile(BonusFile);
    
    return 1;
} 

Ba acest exemplu ti l-am facut cu salvare Mixini,dupa dorinta o sa il faci MySQL

Edited by #Yudin

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.