if(strcmp(cmd, "/hapuskan", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /removeucp [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
new file[64];
new name[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, name, sizeof(name));
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /removeucp [playername]");
format(file, sizeof(file),"LARP/Users/%s.ini", name); //am i wrong??
if(!fexist(file))
{
dini_IntSet(file, "Pending", 0); //am i wrong?
GetPlayerName(playerid, name, sizeof(name));
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You cant use this Commands!! (admin only)");
return 1;
}
}
}
dcmd_unban(playerid, params[])
{
new pName[24], pFile[50], str[256], playerIP[256];
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_RED, "You are not authorized to use that command!");
return true;
}
GetPlayerName(playerid, pName, sizeof(pName));
format(pFile, sizeof(pFile), "LARP/Users/%s.ini", params);
playerIP = dini_Get(pFile, "PlayerIP");
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_GRAD1, "Usage: /unban [playername]");
return true;
}
if(!dini_Exists(pFile))
{
SendClientMessage(playerid, COLOR_GRAD1, "No such player found in the database.");
return true;
}
format(str, sizeof str, "unbanip %s", playerIP);
PlayerInfo[playerid][Locked] = 0;
PlayerInfo[playerid][Banned] = 0;
return true;
}
for unban:
pawn Код:
|
if(!fexist(file))
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /removeucp [playername]");
format(file, sizeof(file),"LARP/Users/%s.ini", name);
dini_IntSet(file, "Pending", 0);
Why do you check this?
pawn Код:
pawn Код:
|
if(strcmp(cmd, "/hapuskan", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /removeucp [playerid/PartOfName]");
return 1;
}
new file[64];
format(file, sizeof(file),"LARP/Users/%s.ini", tmp);
if(fexist(file))
{
dini_IntSet(file, "Pending", 0);
SendClientMessage(playerid, COLOR_GRAD2, "Pending=0");
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Player with that name doesn't exist!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "You cant use this Commands!! (admin only)");
}
return 1;
}
if(strcmp(cmd, "/hapuskan", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /removeucp [playerid/PartOfName]"); return 1; } new file[64]; format(file, sizeof(file),"LARP/Users/%s.ini", tmp); if(fexist(file)) { dini_IntSet(file, "Pending", 0); SendClientMessage(playerid, COLOR_GRAD2, "Pending=0"); } else { SendClientMessage(playerid, COLOR_GRAD2, "Player with that name doesn't exist!"); } } else { SendClientMessage(playerid, COLOR_GRAD2, "You cant use this Commands!! (admin only)"); } return 1; }