Y_ini help
#3

PHP код:

CMD
:givecolourtext(playerid,params[]) 

    new 
id,idname[MAX_PLAYER_NAME],string[128]; 
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_RED"[ERROR]{FFFFFF}: You are not authorised to use this command"); 
    if(
isnull(params)) return SendClientMessage(playerid,COLOR_RED,"Usage: {FFFFFF}/givecolourtext (id)"); 
    if(
pInfo[id][ColourText] == 1) return SendClientMessage(playerid,COLOR_RED"[ERROR]{FFFFFF}: That player already have colourtext, How can you give it twice?"); 
    
GetPlayerName(playerididnamesizeof(idname)); 
    
format(stringsizeof(string), "You have given %s(%d) colour text.",idname,id); 
    
SendClientMessage(playerid, -1string); 
    
SendClientMessage(id, -1"An administrator has given you ColourText. You can now use /colourtext"); 
    new 
INI:File INI_Open(path);
    
INI_SetTag(File"data");
    
INI_WriteInt(File"ColourText"1);
    
INI_Close(File);
    return 
1

and show me your stats saving stock (if any).. have you added the INI_WriteInt line in the stats saving stock? does it works for the player who is online at the moment? As I believe the tag have to be same in the Y_INI and it can't be changed.. Waiting for your reply.

example of a stats saving stock, you can use it in OnPlayerDisconnect or in the command too.
PHP код:
stock SaveStats(playerid)
{
new 
INI:File INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"ColourText",pInfo[id][ColourText]);
return 
1;

Reply


Messages In This Thread
Y_ini help - by xTURBOx - 05.12.2015, 06:41
Re: Y_ini help - by xTURBOx - 07.12.2015, 10:12
Re: Y_ini help - by Logic_ - 07.12.2015, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)