12.12.2016, 11:38
Buenas, estoy realizando mi sistema de maletero de a poco, y me quede trabado en un comando con parametros en el mismo.
Comando:
No se que parte del comando es, pero no tengo respuesta alguna al comando mas que un mensaje del uso del mismo ( "Utiliza: /maletero..." es lo unico que responde.)
Gracias de antemano.
Comando:
Код:
CMD:maletero(playerid, params[]) { if(isnull(params)) { SendClientMessageEx(playerid, COLOR_GREEN, "Utiliza: /maletero (nombre)"); SendClientMessageEx(playerid, COLOR_WHITE, "Nombres: ver, guardar, sacar"); return 1; } else if(strcmp(params, "guardar", true) == 0) { new string[128], weaponchoice[32], slot; if(!sscanf(params, "s[32]d", weaponchoice, slot)) { new pvid = -1, Float: x, Float: y, Float: z; for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++) { if(PlayerVehicleInfo[playerid][d][pvId] != INVALID_PLAYER_VEHICLE_ID) GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z); if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)) { pvid = d; break; } } if(pvid == -1) return SendClientMessageEx(playerid,COLOR_GREY,"{FFFF00}[ERROR]:{FFFFFF} No estбs cerca de un vehнculo que sea tuyo."); new maxslots = 8; if(slot > maxslots) { SendClientMessageEx(playerid, COLOR_GREY, "{FFFF00}[ERROR]:{FFFFFF} Slot Invбlido, del 1 al 8."); return 1; } if( PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] != 0) { SendClientMessageEx(playerid, COLOR_GREY, "{FFFF00}[ERROR]:{FFFFFF} Tienes armas guardadas en ese slot."); return 1; } new weapon; if(strcmp(weaponchoice, "sdpistol", true, strlen(weaponchoice)) == 0) { if( Info[playerid][pWeapons][2] == 23) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Has guardado una pistola SD en tu maletero."); weapon = Info[playerid][pWeapons][2]; format(string,sizeof(string), "* %s guarda un pistola SD en su maletero.", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } else if(strcmp(weaponchoice, "deagle", true, strlen(weaponchoice)) == 0) { if( Info[playerid][pWeapons][2] == 24) { SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Has guardado un Desert Eagle en tu maletero."); weapon = Info[playerid][pWeapons][2]; format(string,sizeof(string), "* %s guarda una Desert Eagle en su maletero.", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } //El codigo del else if se repite con el resto de armas, no lo coloco ya que seria muy largo.... if(weapon == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "No tienes esa arma"); if(PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] == 0) { PlayerVehicleInfo[playerid][pvid][pvWeapons][slot-1] = weapon; RemovePlayerWeapon(playerid, weapon); return 1; } else { SendClientMessageEx(playerid,COLOR_GREY," Nombre invбlido!");} } else return SendClientMessageEx(playerid, COLOR_WHITE, "Utiliza: /maletero (guardar) (arma) (slot)"); } return 1; }
Gracias de antemano.