04.08.2011, 09:45
(
Последний раз редактировалось XpanD; 04.08.2011 в 09:54.
Причина: Title edit for relevancy.
)
Hello,
I have recently integrated my admin filterscript into my gamemode, in an attempt to make a lot of hybrid admin/non-admin commands. Everything is working pretty well, except for one thing - I have a small piece of code that mutes the player if that player has not spawned yet and prevents him/her from using commands. The aim is to make all commands except for /login throw an error message, but things aren't that easy it seems. Have a look at my code.
On top of the script:
Under OnPlayerText:
This works great, if the player is spawn-muted and has not logged in yet he/she cannot chat.
Under OnPlayerCommandText:
This doesn't work so well. /login can actually be used without parameters, but the moment a player enters a password it just throws the mute error message again. I've tried both DCMD and STRCMP implementations of the /login command, but the issue remained the same.
So yeah, how do I make it so /login can be sent parameters despite the spawn mute?
Thanks in advance!
PS. I know I could probably fix it with a login dialog, but I'd rather not go that route as all of the players in my server are used to manually typing /login, and it would kinda ruin the purpose of our nice pre-spawn area.
I have recently integrated my admin filterscript into my gamemode, in an attempt to make a lot of hybrid admin/non-admin commands. Everything is working pretty well, except for one thing - I have a small piece of code that mutes the player if that player has not spawned yet and prevents him/her from using commands. The aim is to make all commands except for /login throw an error message, but things aren't that easy it seems. Have a look at my code.
On top of the script:
pawn Код:
new MuteSpawn[MAX_PLAYERS];
pawn Код:
if(MuteSpawn[playerid] == 1 && AccountInfo[playerid][Register] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW,"This account is registered - you must log in before chatting or using commands! Use /login [password].");
return 0;
}
Under OnPlayerCommandText:
pawn Код:
if(MuteSpawn[playerid] == 1 && strfind("/login", cmdtext, true) == -1 && AccountInfo[playerid][Register] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW,"This account is registered - you must log in before chatting or using commands! Use /login [password].");
return 0;
}
So yeah, how do I make it so /login can be sent parameters despite the spawn mute?
Thanks in advance!
PS. I know I could probably fix it with a login dialog, but I'd rather not go that route as all of the players in my server are used to manually typing /login, and it would kinda ruin the purpose of our nice pre-spawn area.