Admin Ban cmd - 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: Admin Ban cmd (
/showthread.php?tid=408224)
Admin Ban cmd -
Kudoz - 17.01.2013
Hello!
I've this Ban command, and I got some errors.. ?
Код:
dcmd_ban(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, COLOR_BLUE, "Usage: /ban [PlayerID] [Reason]") &&
SendClientMessage(playerid, COLOUR_ORANGE, "Function: Will Ban the specified player");
if(!strlen(tmp2))
return SendClientMessage(playerid, COLOUR_RED, "ERROR: Reason unspecified!");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][pAdmin] != 10))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
new year,month,day; getdate(year, month, day);
new hour,minuite,second; gettime(hour,minuite,second);
format(string,sizeof(string),"{FF0080}.: [Admin] {FFFFFF}( %s ) has Banned ( %s ) from the server{00FF00}[Reason: %s] :.",adminname,playername,params[2]);
SendClientMessageToAll(COLOUR_RED,string);
new str[128];
format(str,sizeof(str),".: ( %s ) has been Banned by Administrator ( %s ) | Reason: %s :.",playername,adminname,params[2]);
print(str);
format(string,sizeof(string),"Banned by Administrator %s. | Reason: %s",adminname,params[2]);
format(largestring, sizeof(largestring), "You Have Been Banned from The Server\n{FF0000}Banned By: {FFFFFF}%s\n{FF0000}Reason: {FFFFFF}%s\n{FF0000}if you feel wrongly banned you can report an unban appeal on our forums\n{33CCFF}www.driftunitz.tk",adminname,params[2]);
ShowPlayerDialog(playername,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");
return BanEx(player1, string);
}
}
else return ErrorMessages(playerid, 1);
return 1;
}
Код:
C:\Users\daniel\Desktop\DriftUnitZ\filterscripts\CrossAdmin.pwn(781) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
The errors is on this line :
Код:
ShowPlayerDialog(playername,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");
Re: Admin Ban cmd -
Norrin - 17.01.2013
Replace this:
pawn Код:
ShowPlayerDialog(playername,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");
With this:
pawn Код:
ShowPlayerDialog(player1,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");
Don't forget to add a reputation if I helped. Thank you, and have a nice day, sir. 
Re: Admin Ban cmd -
Marv! - 17.01.2013
dude, thanks. that helped me too norrin. repped.
Re: Admin Ban cmd -
Joco5 - 17.01.2013
Replace this
ShowPlayerDialog(playername,DIALOG_BAN,DIALOG_STYL E_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");
With This
ShowPlayerDialog(playerid,DIALOG_BAN,DIALOG_STYLE_ MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");