Help?
#6

Create an enum
Код:
enum pInfo
{
    pLevel,
    pCash
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
CMD:levelbonus(playerid,params[])
{
if(PlayerInfo[playerid][pLevel]==3)
{
SendClientMessage(playerid,-1,"You already have Level 3 and 1,000,000$");
return 1;
}
else
{
PlayerInfo[playerid][pLevel]=3;
GivePlayerMoney(playerid,1000000);
PlayerInfo[playerid][pCash]=GetPlayerMoney(playerid);
}
return 1;
}
Under OnPlayerDisconnect
Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
    INI_WriteInt(File,"Level",PlayerInfo[playerid][pLevel]);
    INI_Close(File);
    return 1;
}
Under OnPlayerConnect
Код:
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
Reply


Messages In This Thread
Help? - by Madalyinn - 23.05.2014, 11:26
Re: Help? - by Vaishnav - 23.05.2014, 11:27
Re: Help? - by Fred1993 - 23.05.2014, 11:29
Re: Help? - by Madalyinn - 23.05.2014, 11:30
Re: Help? - by Fred1993 - 23.05.2014, 11:36
Re: Help? - by Rittik - 23.05.2014, 11:41
Re : Help? - by S4t3K - 23.05.2014, 11:45
Re: Help? - by Madalyinn - 23.05.2014, 12:46

Forum Jump:


Users browsing this thread: 2 Guest(s)