SA-MP Forums Archive
Problem with the gates! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with the gates! (/showthread.php?tid=308726)



Help with admin! - Setkus - 04.01.2012

Hey, guys!
I have a problem with zcmd. So here is the code, and i have some errors:


pawn Код:
if(playerDB[playerid][admin])
    {
            CMD:fly(playerid, params[])
        {
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
            SendClientMessage(playerid,0xEA0000FF,"* You got Jet-Pack");
            return 1;
        }
    return 1;
    }
All I want is that only admins can use this commands. But if I put in the command fly this:
pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ORANGE,"Si komanda tik administracijai.");
and when I go into game and type that command it says this command is only for admin. I am admin in this server
Here is the error:
pawn Код:
D:\GTASA~1\ghjhj\GAMEMO~1\band7.pwn(17658) : error 010: invalid function or declaration
D:\GTASA~1\ghjhj\GAMEMO~1\band7.pwn(17662) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Whats the problem? Could you help me? Thanks
Sorry for my bad english


Re: Problem with the gates! - Konstantinos - 04.01.2012

You insert two commands with ZCMD proccesor into this. You can't do that.
Show us some other part of the code because I can't understand what you exactly want to do.


Re: Problem with the gates! - Setkus - 04.01.2012

I just want that for example only admin can open gates. Can you do that for me? Sorry for my bad english.


Re: Problem with the gates! - Setkus - 05.01.2012

So anyone could help me?


Re: Problem with the gates! - FreshDoubleX - 05.01.2012

Remove that PlayerDB thing.. Change your accounts system or something.
With RCON this /fly command should look like this:

pawn Код:
CMD:fly(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ORANGE,"Si komanda tik administracijai.");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
    SendClientMessage(playerid,0xEA0000FF,"* You got Jet-Pack");
    return 1;
}



Re: Problem with the gates! - The God - 05.01.2012

You dont have to change the whole account system, well for me it is a lot more easier with PlayerDB



PS: lietuviski gm skiriasi nuo anglisku, geriau rasytum i lt foruma


Re: Problem with the gates! - Setkus - 05.01.2012

Quote:
Originally Posted by FreshDoubleX
Посмотреть сообщение
Remove that PlayerDB thing.. Change your accounts system or something.
With RCON this /fly command should look like this:

pawn Код:
CMD:fly(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ORANGE,"Si komanda tik administracijai.");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USE JETPACK);
    SendClientMessage(playerid,0xEA0000FF,"* You got Jet-Pack");
    return 1;
}
When i go to the server it says this command is only for admins, but I am admin in that server. So what is it wrong? Maybe there is other ways?