Need help to convert this to rcon... - 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: Need help to convert this to rcon... (
/showthread.php?tid=428950)
Need help to convert this to rcon... -
RandomDude - 07.04.2013
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
Re: Need help to convert this to rcon... -
doreto - 07.04.2013
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)
}
Re: Need help to convert this to rcon... -
RandomDude - 07.04.2013
Can you quickly do it for me please -_- I'm not a pro but I'm doin' sumfin' for my server -_-
Re: Need help to convert this to rcon... -
Sithis - 07.04.2013
Код:
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%.
Re: Need help to convert this to rcon... -
SilverKiller - 07.04.2013
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).
Re: Need help to convert this to rcon... -
Riddick94 - 07.04.2013
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?