Pera , Precisa usar Dini, jб mostro aqui, Agora vou Fazer Temas que estou a ir Mal na Escola
@EDIT: Tenta Esse Code, Usei Algumas Arrays e Diretivas, Bem Simples Olha talvez lhe ajude
pawn Код:
#include <a_samp>
#include <Dini>
new
_Impostos_[MAX_PLAYERS];
#define _StatsFile_ "_Impostos_.txt"
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/imposto", true) == 0)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Uso do Comando: /imposto [VALOR]");
_Impostos_[i] = dini_Int(_StatsFile_, "Imposto");
GivePlayerMoney(i, -_Impostos_[i]);
SetTimer("Impostovalor",2000,true);
if(!dini_Exists(_StatsFile_))
{
dini_Create(_StatsFile_);
dini_IntSet(_StatsFile_, "Imposto", _Impostos_[i]);
}
}
return 1;
}
return 0;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
forward Impostovalor();
public Impostovalor()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
GivePlayerMoney(i, -_Impostos_[i]);
}
return 1;
}