CMD:deletacc(playerid,params[])
{
if(pSuper[playerid][Supremo] >= 1)
{
new file2[155], aname[MAX_PLAYER_NAME], string[125];
GetPlayerName(playerid, aname, sizeof(aname));
format(file2, sizeof(file2), "Contas/%s.ini", aname);
if (DOF2_FileExists(file2)) {
DOF2_RemoveFile(file2);
format(string, sizeof(string), " | INFO | Vocк deletou a conta %s.");
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s", aname);
SendClientMessageToAll(-1, string);
}
else {
SendClientMessage(playerid, -1, " | ERRO | Este usuario nгo existe!");
}
return 1;
}
}
Vocк sempre deve retornar algum valor em comandos via ZCMD para serem utilizados pelas callbacks de uso de comandos (nгo me recordo o nome agora).
Vocк sу estб retornando algum valor se o jogador for supremo. |
CMD:deletacc(playerid,params[]) { if(pSuper[playerid][Supremo] >= 1) { new file2[155], aname[MAX_PLAYER_NAME], string[125]; GetPlayerName(playerid, aname, sizeof(aname)); format(file2, sizeof(file2), "Contas/%s.ini", aname); if (DOF2_FileExists(file2)) { DOF2_RemoveFile(file2); format(string, sizeof(string), " | INFO | Vocк deletou a conta %s."); SendClientMessage(playerid, -1, string); format(string, sizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s", aname); SendClientMessageToAll(-1, string); } else { SendClientMessage(playerid, -1, " | ERRO | Este usuario nгo existe!"); } } return 1; }
Aquele return ali, nгo vai servir de nada se nгo tem nada embaixo do cуdigo que vocк deseja privar caso ele nгo tenha aquele IF.
Entгo usa assim: Code:
CMD:deletacc(playerid,params[]) { if(pSuper[playerid][Supremo] >= 1) { new file2[155], aname[MAX_PLAYER_NAME], string[125]; GetPlayerName(playerid, aname, sizeof(aname)); format(file2, sizeof(file2), "Contas/%s.ini", aname); if (DOF2_FileExists(file2)) { DOF2_RemoveFile(file2); format(string, sizeof(string), " | INFO | Vocк deletou a conta %s."); SendClientMessage(playerid, -1, string); format(string, sizeof(string), " | INFO-SERVER | O Administrador %s deletou a conta: %s", aname); SendClientMessageToAll(-1, string); } else { SendClientMessage(playerid, -1, " | ERRO | Este usuario nгo existe!"); } } return 1; } |