04.01.2014, 15:07
Код:
***************************MAKEADMIN.pwn(175) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
The code is quite messy, as this is one of my first commands I have made, so sorry for the messiness.
Код:
CMD:makeadmin(playerid, params[]) { new id, level; if(IsPlayerAdmin(playerid)) { if (sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Syntax: /makeadmin [id] [level]"); else { new INI:File = INI_Open(UserPath(id)); INI_WriteInt(File, "Admin", level); INI_Close(File); SendClientMessage(playerid, -1, "Staff level has been set!"); new targetid[MAX_PLAYER_NAME+1];GetPlayerName(id, targetid, sizeof(targetid)); new promoter[MAX_PLAYER_NAME+1];GetPlayerName(playerid, promoter, sizeof(promoter)); new string[24+MAX_PLAYER_NAME+1]; new sTring[24+MAX_PLAYER_NAME+1]; new promoted[MAX_PLAYER_NAME+1];GetPlayerName(id, promoted, sizeof(promoted)); format(string, sizeof(string), "AdmCmd: %s has made %s admin level %d", promoter, targetid, level); SendClientMessageToAll(0xAA3333AA, string); format(promoted, sizeof(promoted), "You have been promoted to admin level %d by %s!", level, promoter); SendClientMessage(promoted, 0x00CED1, sTring); } } else return SendClientMessage(playerid, -1, "You are not a Staff Member!"); return 1; }