pawn Код:
if(strcmp(cmd,"/darestudo", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "aAdmin") == 0 ) return SendClientMessage(playerid, Vermelho, "(INFO) Vocк nao e um admin!");
if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
{
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Digite: /darestudo [id] [level]");
skin = strval(tmp);
if(skin < 0 || pAdmin[playerid] > 5) return SendClientMessage(playerid, Vermelho, "Limit max 5 e minimo 0");
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid))
{
format(string, sizeof(string), "(INFO) O Administrador %s (%d) te deu %d Level de estudo.", aname, playerid, skin);
SendClientMessage(plid, tcadm, string);
format(string, sizeof(string), "(INFO) Vocк deu a %s(ID: %d) %d Level de estudo.", pname, plid, skin);
SendClientMessage(playerid, Blue, string);
dini_IntSet(file2, "Faculdade", dini_Int(file2, "Faculdade")+skin);
}
else {
SendClientMessage(playerid, Vermelho, "(INFO) Jogador nгo conectado.");
}
}
return 1;
}