04.08.2012, 17:02
Why do commands work but show as its a unknown command?
like these:
It use to work when it was saving in DINI/Y_INI, but now it keeps on returning unknown command, can there be something to do with MySQL?
like these:
pawn Код:
if(strcmp(cmd, "/ajail", true) == 0)
{
if(IsPlayerConnected(playerid)) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
return 1;
}
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1) {
if(IsPlayerConnected(playa)) {
if(playa != INVALID_PLAYER_ID) {
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
GiveNameSpace(giveplayer);
if(PlayerInfo[playa][pAdmin]>0 && playa!=playerid) {
if(PlayerInfo[playerid][pAdmin] < 10) {
SendClientMessage(playerid, COLOR_GRAD2, "Your admin level is too low to jail other admins.");
return 1;
}
}
if(PlayerInfo[playerid][pHidden] == 1) { sendername = "Hidden Admin"; }
else if(PlayerInfo[playerid][pAdmin] == 11) { sendername = "Hidden Admin"; }
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) {
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) {
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ajail [playerid/PartOfName] [time(minutes)] [reason]");
return 1;
}
format(string, sizeof(string), "* You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* You were Jailed by Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeaponsEx(playa);
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money*60;
Mute[playa] = 1;
PlayerInfo[playa][pAjailc]++;
SetPlayerInterior(playa, 0);
SetPlayerVirtualWorld(playa, playa);
PlayerInfo[playa][pInt] = 0;
DOO_SetPlayerPos(playa,3523.9175,-503.7138,270.5802);
format(string, sizeof(string), "You are jailed for %d minutes.", money);
SendClientMessage(playa, COLOR_WHITE, string);
format(string, 256, "AdmCmd: %s has been jailed by Admin %s for %i minutes [Reason: %s]", giveplayer, sendername,money,(result));
OOCOff(COLOR_LIGHTRED, string);
SavePlayerData(playa);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "AdmCmd: %s has been jailed by Admin %s for %i minutes [Reason: %s]", giveplayer, sendername,money,(result));
JailLog(string);
}
}
}
else {
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}