18.12.2013, 09:19
Try this :
Quote:
CMD:createmapicon(playerid, params[]) { new string[128], type; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); // if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty."); if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createmapicon [icon]"); if(type == 0 || type == 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid mapicon type."); for(new idx=0; idx<MAX_MAPICONS; idx++) { if(!MapIconInfo[idx][mpType]) { MapIconInfo[idx][mpType] = type; GetPlayerPos(playerid, MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ]); MapIconInfo[idx][mpID] = CreateDynamicMapIcon(MapIconInfo[idx][mpX], MapIconInfo[idx][mpY], MapIconInfo[idx][mpZ], MapIconInfo[idx][mpType], 100); format(string, sizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created mapicon ID %d.", RPN(playerid), idx); SendAdminMessage(COLOR_DARKRED, 1, string); Log("logs/mapicons.log", string); idx = MAX_DOORS; } } return 1; } |