What's wrong with this? +rep
#3

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
I didn't quite get your problem. Do you want an command that reads the value stored inside a flatfile?
Alright. I made a command to give a player a cookie, which will then save it in a file, along with the rest of the variables.
Here's the givecookie command.
pawn Код:
CMD:givecookie(playerid, params[]) // CMD for giving somebody a cookie
{
    new pid;
    new reason[128];
    new str[128];
    if(sscanf(params, "us[128]", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecookie [Player ID] [Reason]");
    if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "PlayerID is not connected.");
    if(PlayerInfo[playerid][pAdmin]>=2)
    {
     format(str, sizeof(str), "%s has been granted a cookie by Administrator %s. Reason: (%s)", GetName(pid), GetName(playerid), reason);
     SendClientMessageToAll(COLOR_ORANGE, str);
     format(str, sizeof(str), "You just gave a cookie to %s.", GetName(pid));
     SendClientMessage(playerid, COLOR_GREEN, str);
     new INI:File = INI_Open(UserPath(playerid));
     INI_WriteInt(File,"Cookies",PlayerInfo[playerid][pCookies]);
     INI_Close(File);
     PlayerInfo[pid][pCookies] ++;
    }
    else SendClientMessage(playerid, COLOR_BRIGHTRED, "You're not authorized to use this command.");
    return 1;
}
Now... I want to make it, so Administrators can use the command /cookies, to check a players current cookies.
Reply


Messages In This Thread
What's wrong with this? +rep - by rangerxxll - 06.03.2012, 21:43
Re: What's wrong with this? +rep - by Cameltoe - 06.03.2012, 21:51
Re: What's wrong with this? +rep - by rangerxxll - 06.03.2012, 21:53
Re: What's wrong with this? +rep - by Cameltoe - 06.03.2012, 21:59
Re: What's wrong with this? +rep - by Basicz - 06.03.2012, 21:59
Re: What's wrong with this? +rep - by Cameltoe - 06.03.2012, 22:01
Re: What's wrong with this? +rep - by rangerxxll - 06.03.2012, 22:12
Re: What's wrong with this? +rep - by rangerxxll - 06.03.2012, 22:14
Re: What's wrong with this? +rep - by rangerxxll - 06.03.2012, 23:58
Re: What's wrong with this? +rep - by Basicz - 07.03.2012, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)