01.02.2014, 04:46
I simply try to make a DMP Markertype with any ID. (via; 54 Gym Icon) All it does is repeat to ID 20 or 21. Here is the command and here is the result I get.
Quote:
CMD:dmpedit(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!"); return 1; } new string[128], choice[32], mapiconid, amount; if(sscanf(params, "s[32]dD", choice, mapiconid, amount)) { SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /dmpedit [name] [mapiconid] [(Optional)amount]"); SendClientMessageEx(playerid, COLOR_GREY, "Available names: Position, MarkerType, Color, Delete"); return 1; } if(mapiconid < 0 || mapiconid >= MAX_DMAPICONS) { SendClientMessageEx( playerid, COLOR_WHITE, "Invalid Map Icon ID!"); } if(strcmp(choice, "position", true) == 0) { GetPlayerPos(playerid, DMPInfo[mapiconid][dmpPosX], DMPInfo[mapiconid][dmpPosY], DMPInfo[mapiconid][dmpPosZ]); DMPInfo[mapiconid][dmpInt] = GetPlayerInterior(playerid); DMPInfo[mapiconid][dmpVW] = GetPlayerVirtualWorld(playerid); SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the position!"); if(IsValidDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID])) DestroyDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID]); DMPInfo[mapiconid][dmpMapIconID] = CreateDynamicMapIcon(DMPInfo[mapiconid][dmpPosX], DMPInfo[mapiconid][dmpPosY], DMPInfo[mapiconid][dmpPosZ], DMPInfo[mapiconid][dmpMarkerType], DMPInfo[mapiconid][dmpColor], DMPInfo[mapiconid][dmpVW], DMPInfo[mapiconid][dmpInt], -1, 500.0); SaveDynamicMapIcons(); format(string, sizeof(string), "%s has edited MapIconID %d's Position.", GetPlayerNameEx(playerid), mapiconid); Log("logs/dmpedit.log", string); return 1; } else if(strcmp(choice, "delete", true) == 0) { SendClientMessageEx(playerid, COLOR_WHITE, "You have deleted the map icon!"); DMPInfo[mapiconid][dmpPosX] = 0.0; DMPInfo[mapiconid][dmpPosY] = 0.0; DMPInfo[mapiconid][dmpPosZ] = 0.0; DMPInfo[mapiconid][dmpVW] = 0; DMPInfo[mapiconid][dmpInt] = 0; DMPInfo[mapiconid][dmpMarkerType] = 0; DMPInfo[mapiconid][dmpColor] = 0; SaveDynamicMapIcons(); if(IsValidDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID])) DestroyDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID]); format(string, sizeof(string), "%s has deleted MapIconID %d.", GetPlayerNameEx(playerid), mapiconid); Log("logs/dmpedit.log", string); return 1; } else if(strcmp(choice, "markertype", true) == 0) { DMPInfo[mapiconid][dmpMarkerType] = amount; format(string, sizeof(string), "You have set the marker type to %d.", amount); SendClientMessageEx(playerid, COLOR_WHITE, string); if(IsValidDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID])) DestroyDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID]); DMPInfo[mapiconid][dmpMapIconID] = CreateDynamicMapIcon(DMPInfo[mapiconid][dmpPosX], DMPInfo[mapiconid][dmpPosY], DMPInfo[mapiconid][dmpPosZ], DMPInfo[mapiconid][dmpMarkerType], DMPInfo[mapiconid][dmpColor], DMPInfo[mapiconid][dmpVW], DMPInfo[mapiconid][dmpInt], -1, 500.0); format(string, sizeof(string), "%s has edited MapIconID %d's Marker Type to %d.", GetPlayerNameEx(playerid), mapiconid, amount); Log("logs/dmpedit.log", string); } else if(strcmp(choice, "color", true) == 0) { DMPInfo[mapiconid][dmpColor] = amount; format(string, sizeof(string), "You have set the color to %d.", amount); SendClientMessageEx(playerid, COLOR_WHITE, string); if(IsValidDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID])) DestroyDynamicMapIcon(DMPInfo[mapiconid][dmpMapIconID]); DMPInfo[mapiconid][dmpMapIconID] = CreateDynamicMapIcon(DMPInfo[mapiconid][dmpPosX], DMPInfo[mapiconid][dmpPosY], DMPInfo[mapiconid][dmpPosZ], DMPInfo[mapiconid][dmpMarkerType], DMPInfo[mapiconid][dmpColor], DMPInfo[mapiconid][dmpVW], DMPInfo[mapiconid][dmpInt], -1, 500.0); format(string, sizeof(string), "%s has edited MapIconID %d's Color to %d.", GetPlayerNameEx(playerid), mapiconid, amount); Log("logs/dmpedit.log", string); } SaveDynamicMapIcons(); return 1; } |