23.08.2014, 17:13
(
Последний раз редактировалось Thomixio; 23.08.2014 в 18:02.
Причина: Added [SOLVED] in hope of not wasting any others time.
)
So I am just editing a 'basic gamemode' that got released, MySQL based. I have been looking at this code for years, and still can't see what's wrong. I have edited, but it hasn't worked so I have absolutely no clue what's wrong here. I am a newbie scripter, do not expect that I know everything. I gave myself admin level 6, and then I should have rights to kick if you look, everyone with admin level 1 and above should be able to kick.
It always says "They aren't connected, or have a higher admin rank than you.", as it was a problem with the ID but there shouldn't be, because I got e.g a poke command that was in the script, with exact similar code (ofc a bit difference, but scripted in the same way) which worked, so it can't be anything wrong with the IDs as far as I know.
It always says "They aren't connected, or have a higher admin rank than you.", as it was a problem with the ID but there shouldn't be, because I got e.g a poke command that was in the script, with exact similar code (ofc a bit difference, but scripted in the same way) which worked, so it can't be anything wrong with the IDs as far as I know.
PHP код:
CMD:kick(playerid, params[])
{
if(pInfo[playerid][pAdmin] >= 1)
{
new giveplayerid, reason[128], string[200];
if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
if(IsPlayerConnected(giveplayerid) && pInfo[playerid][pAdmin] < pInfo[giveplayerid][pAdmin])
{
format(string, sizeof(string), "AdmCmd: %s has been kicked from the server by Administrator %s, Reason: %s", GetName(giveplayerid), GetName(playerid), reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
print(string);
format(string, sizeof(string), "SERVER: You have been kicked from the server by Admin %s, for: %s.", GetName(playerid), reason);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
IsLoggedIn[giveplayerid] = 0;
LoginAttempts[giveplayerid] = 0;
SetTimerEx("KickPublic", 1000, false, "i", playerid);
return 1;
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "They aren't connected, or have a higher admin rank than you.");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You do not have permission to use this command.");
}
It's probably something very obvious that I have missed, but once again I am a newbie scripter.