Help with these commands [+ Rep] -
sniperwars - 27.02.2012
Hey guys,
The commands I want in dialog format are:
/acmdlist
pawn Код:
dcmd_acmdlist(playerid,params[])
{
#pragma unused params
if(Plr[playerid][pLevel] < 1 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY,"You need to be level 1 admin to do that");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 1]: /acmdlist /asay <text> /announce <text> /whois <player id> /track <player id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 1]: /lock <password>, /unlock /goto <player id> /vgoto <vehicle id> /slap <player id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 1]: /mute <player id> <reason> /unmute <player id> /spawn <player id> /disarm <player id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 1]: /jetpack <player id> /vcolor <color 1> <color 2> /kick <player id> <reason> /sethp <player id> <amount>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 2]: /setarmour <player id> <amount> /weapon <player id> <weapon id> <ammo> /get <player id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 3]: /freeze <player id> /unfreeze <player id> /explode <player id> /vehicle <name/id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 3]: /ban <player id> <reason> /crash <player id> /banip <ip> /unbanip <ip> /clrchat");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 4]: /allowchat /cmdstealth <0-1> /gravity <gravity> /vdestroy <vehicle id>");
SendClientMessage(playerid,COLOR_LBLUE,"[LEVEL 5]: /cobject <object id> /dobject <object id> /setlevel <player id> <0-5>, /gmx");
return 1;
}
/admins
pawn Код:
dcmd_admins(playerid,params[])
{
#pragma unused params
new tstr[128], count = 0;
format(tstr,128,"Admins online:");
for(new i = 0; i <= pmaxid; i++)
{
if(IsPlayerConnected(i) && Plr[i][pLevel] > 0)
{
if(count == 0) format(tstr,128,"%s %s [%d]",tstr,Names[i],Plr[i][pLevel]);
else format(tstr,128,"%s, %s [%d]",tstr,Names[i],Plr[i][pLevel]);
count++;
}
}
if(count == 0) return SendClientMessage(playerid,COLOR_BLUE,"Admins online: none");
else return SendClientMessage(playerid,COLOR_BLUE,tstr);
}
Can anyone help by put these into dialog format ?
Regards, Sniperwars aka Fr3ak
Re: Help with these commands [+ Rep] -
ArmyOps - 27.02.2012
SendClientMessage(playerid,COLOR_BLUE,"Admins online: none");
Put this in dialog format, like
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Notice","Admins online: none","Close","");
To make list of dialog, for commands, then use it as:
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Admin Commands","Level 1\r\nLevel 2\r\nLevel 3","Select", "Close");
Else use just this link to get more help...
https://sampforum.blast.hk/showthread.php?tid=109610
Re: Help with these commands [+ Rep] -
Konstantinos - 27.02.2012
pawn Код:
dcmd_acmdlist( playerid, params[ ] )
{
#pragma unused params
new sz_msg[ 900 ];
if( Plr[ playerid ][ pLevel ] < 1 && !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, COLOR_GREY, "You need to be level 1 admin to do that" );
strcat( sz_msg, "[LEVEL 1]: /acmdlist /asay <text> /announce <text> /whois <player id> /track <player id>\r\n" );
strcat( sz_msg, "[LEVEL 1]: /lock <password>, /unlock /goto <player id> /vgoto <vehicle id> /slap <player id>\r\n" );
strcat( sz_msg, "[LEVEL 1]: /mute <player id> <reason> /unmute <player id> /spawn <player id> /disarm <player id>\r\n" );
strcat( sz_msg, "[LEVEL 1]: /jetpack <player id> /vcolor <color 1> <color 2> /kick <player id> <reason> /sethp <player id> <amount>\r\n" );
strcat( sz_msg, "[LEVEL 2]: /setarmour <player id> <amount> /weapon <player id> <weapon id> <ammo> /get <player id>\r\n" );
strcat( sz_msg, "[LEVEL 3]: /freeze <player id> /unfreeze <player id> /explode <player id> /vehicle <name/id>\r\n" );
strcat( sz_msg, "[LEVEL 3]: /ban <player id> <reason> /crash <player id> /banip <ip> /unbanip <ip> /clrchat\r\n" );
strcat( sz_msg, "[LEVEL 4]: /allowchat /cmdstealth <0-1> /gravity <gravity> /vdestroy <vehicle id>\r\n" );
strcat( sz_msg, "[LEVEL 5]: /cobject <object id> /dobject <object id> /setlevel <player id> <0-5>, /gmx\r\n" );
ShowPlayerDialog( playerid, 3242, DIALOG_STYLE_MSGBOX, "Admin Command List", sz_msg, "Close", "" );
return 1;
}
dcmd_admins(playerid,params[])
{
#pragma unused params
new tstr[128], count = 0;
format(tstr,128,"Admins online:");
for(new i = 0; i <= pmaxid; i++)
{
if(IsPlayerConnected(i) && Plr[i][pLevel] > 0)
{
if(count == 0) format(tstr,128,"%s %s [%d]\n",tstr,Names[i],Plr[i][pLevel]);
else format(tstr,128,"%s, %s [%d]\n",tstr,Names[i],Plr[i][pLevel]);
count++;
}
}
if(count == 0) return SendClientMessage(playerid,COLOR_BLUE,"Admins online: none");
else return ShowPlayerDialog( playerid, 3243, DIALOG_STYLE_MSGBOX, "Admin List", tstr, "Close", "" );
}
Re: Help with these commands [+ Rep] -
sniperwars - 27.02.2012
Edit: Thanks for helping.
I have given you rep by the way.
Re: Help with these commands [+ Rep] -
sniperwars - 27.02.2012
I now get this warning:
Код:
warning 203: symbol is never used: "Playername"
Any fix for it ?
Re: Help with these commands [+ Rep] -
Konstantinos - 27.02.2012
It's warning, not error.
Just delete the variable because you aren't using it.
pawn Код:
new Playername[ MAX_PLAYER_NAME ];
Re: Help with these commands [+ Rep] -
sniperwars - 27.02.2012
That's not even in my script by the way.
Re: Help with these commands [+ Rep] -
sniperwars - 27.02.2012
The warning says it's on line 941 but there is only 940 lines in the script.
Re: Help with these commands [+ Rep] -
Chrillzen - 27.02.2012
In in the top of your script or where-ever you keep your variables.
Re: Help with these commands [+ Rep] -
sniperwars - 27.02.2012
These are my variables:
Код:
new Plr[SLOTS][pInfo];
new Names[SLOTS][24];
new dinistr[256];
new pmaxid;
new bool:Chat = true;
new CmdStealth;