Few problems -
xir - 09.01.2011
I have some problems with admin jail commands
when player jailed it just says 0 seconds and i dont get teleported to the lspd jail(the coordinates must be right)
pawn Код:
dcmd_jail(playerid, params[])
{
if(!PLVL[playerid]) return 0;
new pid, adminname[MAX_PLAYER_NAME], paramname[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pAdminLevel] >=1)
{
if(sscanf(params, "ud", pid)) return SendClientMessage(playerid, Yellow, "Usage: /ajail <playerid> <time>");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, Red, "This player is not connected");
new Second, string[128], string2[128], string3[128], string4[128];
GetPlayerName(pid, paramname, sizeof(paramname));
GetPlayerName(playerid, adminname, sizeof(adminname));
new file[256], name[MAX_PLAYER_NAME];
format(file, sizeof(file), SERVER_USER_FILE, name);
if(dini_Exists(file))
{
dini_IntSet(file, "Jailed", Second);
}
format(string, sizeof(string), "%s (ID: %d) has been jailed by %s for %d seconds", paramname, pid, adminname, Second);
format(string2, sizeof(string2), "You have been jailed by %s for %d seconds", adminname, Second);
SendClientMessageToAll(AdminColor, string);
SendClientMessage(pid,AdminColor,string2);
SetPlayerInterior(pid,6);
SetPlayerPos(pid, 64.6288,77.5742,1001.0391);
SetPlayerArmour(pid,0);
ResetPlayerWeapons(pid);
SetTimerEx ("Unjail", Second*1000, 0, "i", pid);
} else if(PlayerInfo[playerid][pAdminLevel] == 0) return 0;
return 1;
}
pawn Код:
public Unjail (pid)
{
SetPlayerInterior(pid,0);
SetPlayerPos(pid,1383.1418,2185.1440,11.0234);
TogglePlayerControllable(pid,1);
}
and also this, i made if you type 3 times wrong password you get kicked, but here you get kicked if you just type it wrong 1 time
here is code
pawn Код:
new PasswordLogTries[MAX_PLAYERS];
under onplayerconnect
pawn Код:
PasswordLogTries[playerid] = 0;
i will just show dialog 2(login dialog)
pawn Код:
if (dialogid == 2)
{
new name[MAX_PLAYER_NAME], file[128], pid;
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Enter your password", "Login", "Quit");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp)
{
PasswordLogTries[playerid]++;
if(PasswordLogTries[playerid] < 3) ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Wrong password ! \nEnter your password", "Login", "Quit");
SendClientMessage(playerid, AdminColor, "Too many incorrect passwords!");
Kick(pid);
}
i really need help on these ones
i dont get any errors/warnings
Re: Few problems -
xir - 09.01.2011
bump
Re: Few problems -
Mr.Stranger - 09.01.2011
Jail Coordinates
pawn Код:
SetPlayerInterior(playerid, 6)
SetPlayerPos(playerid,264.6288,77.5742,1001.0391);
Re: Few problems -
xir - 09.01.2011
The coordinates must be right, if i use yours still i spawn at the spawn location, the problem is the timer, as i said above it says 0 seconds.. so how to fix this timer problem
Re: Few problems -
Mike Garber - 09.01.2011
I can't see that you defined "Seconds" nowhere...
Re: Few problems -
MadeMan - 09.01.2011
You don't save Second with sscanf
pawn Код:
if(sscanf(params, "ud", pid, Second)) return SendClientMessage(playerid, Yellow, "Usage: /ajail <playerid> <time>");
pawn Код:
if(udb_hash(inputtext) != tmp)
{
PasswordLogTries[playerid]++;
if(PasswordLogTries[playerid] < 3)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Wrong password ! \nEnter your password", "Login", "Quit");
}
else
{
SendClientMessage(playerid, AdminColor, "Too many incorrect passwords!");
Kick(playerid);
}
}
Re: Few problems -
xir - 09.01.2011
oke Mademan, could you show me and also, the code you gave me, it just logs me in whatever i type