19.03.2016, 12:23
I will not "post a working command here", but what you could do on your own to figure out the faulty spot is adding debug messages into your script (or use jernejl's plugin for that matter)
You could add debug messages e.g. like this:
the 3 "printf"s are just examples, but they will show you which parts are getting called and which aren't...
BTW you know the existance of the "Edit" button? Should use it and not create multiple topics for the same subject. More threads will not get your more help and rather less qualified help
You could add debug messages e.g. like this:
Код:
IRP:oprison(playerid, var[])
{
printf("Called command");
new user[32], string[128], file[32], time;
if(!Logged(playerid)) return NoLogin(playerid);
printf("Player is logged in");
if(Player[playerid][pAdmin] < 3) return NoAuth(playerid);
printf("Player has required admin rights");
if(sscanf(var, "s[32]is[128]", user, time, var)) return SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /oprison [playername] [time] [reason]");
if(RPIDFN(user) != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2, "Player is connected to the server, use /prison instead.");
format(file, sizeof(file), "Accounts/%s.ini", user);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_GRAD2, "Player name not found.");
if(Player[playerid][pAdmin] < dini_Int(file, "Admin")) return SendClientMessage(playerid, COLOR_GRAD2, "Player has a higher admin level than you.");
format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid), var);
SendClientMessageToAll(COLOR_LIGHTRED, string);
format(string, sizeof(string), "AdmCmd: %s has been offline-prisoned by %s, reason: %s", user, GetName(playerid) , var);
// Prisoning
dini_IntSet(file, "pJail", 1);
// Prisonreason
dini_Set(file, "pJailReason", var);
dini_Set(file, "pJailBy", GetName(playerid));
dini_IntSet(file, "pJailTime", time);
return 1;
}
BTW you know the existance of the "Edit" button? Should use it and not create multiple topics for the same subject. More threads will not get your more help and rather less qualified help

