Scripting Help
#1

i want /blockcommands (command) for my admin system, because sometimes player makes /go many times so i want to block his commands for minutes, i searched for it but didn't get it, please help.
Reply
#2

:bumb:
Reply
#3

i just want to help

place it somewhere in your script (on the top under the #include <a_samp>)
pawn Код:
new bool:CmdBlocked;
inside of the /blockcommands
pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not rcon administrator");
CmdBlocked = ((CmdBlocked) ? false : true);
SendClientMessage(playerid, -1, (CmdBlocked) ? "Command unblocked" : "Command blocked");
and inside the command that you want to block when it's blocked
pawn Код:
if(CmdBlocked) return SendClientMessage(playerid, -1, "Command is currently disabled");
Reply
#4

Код:
SendClientMessage(playerid, -1, (CmdBlocked) ? "Command unblocked" : "Command blocked");
This line have an error :

Код:
error 001: expected token: "-string end-", but found "-identifier-"
Reply
#5

it's worked for me with no error at all

but you can replace that line with this
pawn Код:
if(CmdBlocked) SendClientMessage(playerid, -1, "Command blocked");
else SendClientMessage(playerid, -1, "Command unblocked");
or
pawn Код:
SendClientMessage(playerid, -1, ((CmdBlocked) ? "Command blocked" : "Command unblocked"));
Reply
#6

Replace this:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not rcon administrator");
with this:

Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not rcon administrator")
When there's a "if" this ";" shouldn't be there.
Reply
#7

Quote:
Originally Posted by Bek_Loking
Посмотреть сообщение
Replace this:
Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not rcon administrator");
with this:

Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "you are not rcon administrator")
When there's a "if" this ";" shouldn't be there.
you've made a mistake
it was the "if" end. it was returned to SendClientMessage.
Reply
#8

Sorry i didn't focus to the command i want this to do it for players not for myself
Reply
#9

Quote:
Originally Posted by kirostar
Посмотреть сообщение
Sorry i didn't focus to the command i want this to do it for players not for myself
yeah. if you do like what i said, the command will blocked for everyone in your server.(if you block it ofcourse)
Reply
#10

use bools instead of local variable
Reply


Forum Jump:


Users browsing this thread: