17.01.2013, 13:22
Hello!
I've this Ban command, and I got some errors.. ?
The errors is on this line :
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.
Код:
ShowPlayerDialog(playername,DIALOG_BAN,DIALOG_STYLE_MSGBOX,"{808080}BANNED",largestring,"Ok","Ok");