Need help to convert this to rcon...
#1

Quote:

dcmd_setclans(playerid,params[])
{
#pragma unused params
format(pS[String], 128, "");
for(new p = 0;p <10; p++)
{
format(pS[String], 128, "%s%s\n",pS[String],ClanInfo[p][fName]);
}
return ShowPlayerDialog(playerid,ClanDialog+15, DIALOG_STYLE_LIST,"Clan List", pS[String], "Set", "Close");
}

I want to make that all so rcon login admins can only /setclans
thanks in advance
Reply
#2

pawn Код:
if(IsPlayerAdmin(playerid)) // if player is rcon admin
{
    // proceed to your code (can use setclans command)
}else
{
    // when player is not rcon admin (can't use setclans command)
}
Reply
#3

Can you quickly do it for me please -_- I'm not a pro but I'm doin' sumfin' for my server -_-
Reply
#4

Код:
dcmd_setclans(playerid, params[])
{
   If(IsPlayerAdmin(playerid)
   {
      // do the set clan
    }
    Else
    {
       // dont do it
    }
}
Thats basically it. Typed this from my phone so it's not a 100%.
Reply
#5

pawn Код:
dcmd_setclans(playerid,params[])
{
    #pragma unused params
    if(!IsPlayerAdmin(playerid)) // If the player is not a rcon admin, it shows the above message to the player.
    {
        return SendClientMessage(playerid, -1, "You need to be a rcon admin to use this command!");
        return 1;
    }
    else // If he is a rcon admin, it completes the command
    {
        format(pS[String], 128, "");
        for(new p = 0;p <10; p++)
        {
            format(pS[String], 128, "%s%s\n",pS[String],ClanInfo[p][fName]);
        }
        return ShowPlayerDialog(playerid,ClanDialog+15, DIALOG_STYLE_LIST,"Clan List", pS[String], "Set", "Close");
    }
    return 1;
}
This should work fine (I also said what happens if the player is a rcon admin or if the player is not a rcon admin).
Reply
#6

Quote:
Originally Posted by RandomDude
Посмотреть сообщение
Can you quickly do it for me please -_- I'm not a pro but I'm doin' sumfin' for my server -_-
Wait, what? So, you know how iterations working & formats.. you've done some filterscripts where you used if statements.. but you can't put a security if statement to the command?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)