06.09.2011, 19:50
PHP код:
CMD:guardartabaco(playerid, params[])
{
ClearAnimations(playerid);
SendClientMessage(playerid, COLOR_GREEN, "Guardaste um maзo da marca Camel.");
new stryng[42],
NomedoCara[MAX_PLAYER_NAME];
GetPlayerName(playerid, NomedoCara, sizeof(NomedoCara));
format(stryng, sizeof(stryng), "/Tabaco/%s.ini", NomedoCara);
if(!dini_Exists(stryng)) { dini_Create(stryng); }
dini_IntSet(stryng,"TabacoDoPlayer", Cig[playerid]);
return true;
}
E esse tb:
PHP код:
CMD:guardartabaco(playerid, params[])
{
new QuantiaTabaco,
stryng[42],
NomedoCara[MAX_PLAYER_NAME];
if(sscanf(params, "d", QuantiaTabaco)) return SendClientMessage(playerid, -1, "Correto: /guardartabaco [Quantia]");
if(QuantiaTabaco > Cig[playerid]) return SendClientMessage(playerid, -1, "Voce nгo tem esse tanto de tabaco!");
ClearAnimations(playerid);
format(stryng, sizeof(stryng), "Vocк guardou %d tabacos.", QuantiaTabaco);
SendClientMessage(playerid, COLOR_GREEN, stryng);
GetPlayerName(playerid, NomedoCara, sizeof(NomedoCara));
format(stryng, sizeof(stryng), "/Tabaco/%s.ini", NomedoCara);
if(!dini_Exists(stryng)) { dini_Create(stryng); }
dini_IntSet(stryng,"TabacoDoPlayer", QuantiaTabaco);
Cig[playerid] =- QuantiaTabaco;
return true;
}