SA-MP Forums Archive
[URGENT] problem with command - 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: [URGENT] problem with command (/showthread.php?tid=412419)



[URGENT] problem with command - RiChArD_A - 01.02.2013

Hi ladies and gentlemen, I have this little CMD on my SV but there is a problem, players can use it even of they aren't logged as admins. Here is the code:
pawn Код:
CMD:adminhouse(playerid, params[])
    {
    if(IsPlayerAdmin(playerid))
    SetPlayerHealth(playerid, 100.00);
    SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
    return 1;
    }
Please help me with this is really important. Thank you.


Re: [URGENT] problem with command - Sime30 - 01.02.2013

pawn Код:
CMD:adminhouse(playerid, params[])
    {
         if(IsPlayerAdmin(playerid))
         {
               SetPlayerHealth(playerid, 100.00);
               SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
         }
         return 1;
    }



Respuesta: [URGENT] problem with command - Strier - 01.02.2013

pawn Код:
CMD:adminhouse(playerid, params[])
    {
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin");
               {
                 SetPlayerHealth(playerid, 100.00);
                 SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
               }
    return 1;
    }
Try this


Re: [URGENT] problem with command - Naruto_Emilio - 01.02.2013

by admin you mean, rcon administrators, or your admin system


Respuesta: Re: [URGENT] problem with command - RiChArD_A - 01.02.2013

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
by admin you mean, rcon administrators, or your admin system
Yes rcon administrator.


Quote:
Originally Posted by Strier
Посмотреть сообщение
pawn Код:
CMD:adminhouse(playerid, params[])
    {
    if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin");
               {
                 SetPlayerHealth(playerid, 100.00);
                 SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
               }
    return 1;
    }
Try this
Did not work.


Re: [URGENT] problem with command - Naruto_Emilio - 01.02.2013

pawn Код:
CMD:adminhouse(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 100.00);
        SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are unable to use this command [Rcon Administrators Only!].");
    }
    return 1;
}



Re: [URGENT] problem with command - Sime30 - 01.02.2013

pawn Код:
CMD:adminhouse(playerid, params[])
    {
         if(IsPlayerAdmin(playerid))
         {
               SetPlayerHealth(playerid, 100.00);
               SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
         }
         else
         {
               SendClientMessage(playerid, COLOR_GREY, "You're not an Admin!");
         }
         return 1;
    }



Re: [URGENT] problem with command - ThePhenix - 01.02.2013

PHP код:
CMD:adminhouse(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        
SetPlayerHealth(playerid100.00);
        
SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
        
SendClientMessage(playerid, -1"You have been teleported to admin's house.");
    }
    else
    {
        
SendClientMessage(playerid, -1"ERROR, You're not a RCON Administrator to use this command");
    }
    return 
1;




Respuesta: Re: [URGENT] problem with command - RiChArD_A - 01.02.2013

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
pawn Код:
CMD:adminhouse(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 100.00);
        SetPlayerPos(playerid,-687.9445,953.5914,12.1495);
    }
    else
    {
        SendClientMessage(playerid, -1, "You are unable to use this command [Rcon Administrators Only!].");
    }
    return 1;
}
Yes! WORKING! Thank you men! and thanks to everyone who answered.