06.01.2015, 19:01
Hello, yes, it's me again if you've seen my previous topics today!
I'll try and explain it briefly.
I'm thinking of making an inventory system, and I'm probably gonna use the enums for that.
Sort of like this:
What I want to know is though, how do I make a dialog in which it shows the quantity of rations, to the person.
Basically, him doing a command like /inventory
and a dialogue would pop up, in which he could see
Rations ---- 1(or any number, depending how many of them he has)
Medkits ---- 5(or any number, depending how many of them he has)
I need it to somehow read the amount from the .ini file, and put it into the dialogue.
Do you guys think you can help? :/
I'll try and explain it briefly.
I'm thinking of making an inventory system, and I'm probably gonna use the enums for that.
Sort of like this:
pawn Код:
enum pInfo
{
pRation,
pMedKit
}
pawn Код:
CMD:giveration(playerid, params[])
{
if(PlayerInfo[playerid][pRation] >= 1) {
new PID;
new Playername1[MAX_PLAYER_NAME], Playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Playername2, sizeof(Playername2));
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", PID)) return SendClientMessage(playerid, 0xFF0000FF, "[USAGE]: /giveration [PlayerID]");
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, -1, "Player is not connected!");
PlayerInfo[playerid][pRation]--;//decreases a point from rations in the .ini file, and basically says you gave away 1 ration
PlayerInfo[PID][pRation]++; // adds point to the other players rations.
}
else //if he has no rations
{
SendClientMessage(playerid, -1, "You don't have any rations to give away!");
}
return 1;
}
What I want to know is though, how do I make a dialog in which it shows the quantity of rations, to the person.
Basically, him doing a command like /inventory
and a dialogue would pop up, in which he could see
Rations ---- 1(or any number, depending how many of them he has)
Medkits ---- 5(or any number, depending how many of them he has)
I need it to somehow read the amount from the .ini file, and put it into the dialogue.
Do you guys think you can help? :/