30.03.2016, 02:42
Adaptй un sistema de bolsillos que funcionaba bien, cuando tiras un objeto al suelo no se crea y deberнa ya que el cуdigo esta correcto, asн es el comando y la funciуn de tirar el objeto(crearlo) darй reputaciуn a quien me resuelva esto, saludos y buenas noches.
Код:
CMD:tirar(playerid, params[])
{
ActualizarManos(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo puedes usar este comando en un vehнculo!");
new
Mano[20], string[68];
if(sscanf(params, "s[12]", Mano)) return SendClientMessage(playerid, COLOR_NARANJA, "* /tirar [Izq/Der/Objetos]");
if(strcmp(Mano,"izq",true) == 0)
{
if(Informacion[playerid][pManoIzq] == 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo tienes nada en tu mano izquierda!");
if(Informacion[playerid][pServicioPD] > 0 && ObjetoInfo[Informacion[playerid][pManoIzq]][IDArma] != 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo puedes tirar armas estando de servicio!");
if(Informacion[playerid][pServicioPD] > 0 && (Informacion[playerid][pManoIzq] >= 39 && Informacion[playerid][pManoIzq] <= 53)) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo puedes tirar municiones estando de servicio!");
format(string, sizeof(string), "* Has dejado tu {fce80c}%s (%d) {FFFFFF}en el suelo.", ObjetoInfo[Informacion[playerid][pManoIzq]][NombreObjeto], Informacion[playerid][pManoIzqCant]);
SendClientMessage(playerid, COLOR_BLANCO, string);
Informacion[playerid][pManoIzq] = 0;
Informacion[playerid][pManoIzqCant] = 0;
RemovePlayerAttachedObject(playerid, 2);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
DropObjeto(Informacion[playerid][pManoIzq], Informacion[playerid][pManoIzqCant], X, Y+0.3, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
}
else if(strcmp(Mano,"der",true) == 0)
{
if(Informacion[playerid][pManoDer] == 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo tienes nada en tu mano derecha!");
if(Informacion[playerid][pServicioPD] > 0 && ObjetoInfo[Informacion[playerid][pManoDer]][IDArma] != 0) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo puedes tirar armas estando de servicio!");
if(Informacion[playerid][pServicioPD] > 0 && (Informacion[playerid][pManoDer] >= 39 && Informacion[playerid][pManoDer] <= 53)) return SendClientMessage(playerid, COLOR_GRIS, "Info: "#CROSA"[!]"#CGRIS2" ЎNo puedes tirar municiones estando de servicio!");
format(string, sizeof(string), "* Has dejado tu {fce80c}%s (%d) {FFFFFF}en el suelo.", ObjetoInfo[Informacion[playerid][pManoDer]][NombreObjeto], Informacion[playerid][pManoDerCant]);
SendClientMessage(playerid, COLOR_BLANCO, string);
Informacion[playerid][pManoDer] = 0;
Informacion[playerid][pManoDerCant] = 0;
RemovePlayerAttachedObject(playerid, 1);
ResetPlayerWeapons(playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
DropObjeto(Informacion[playerid][pManoDer], Informacion[playerid][pManoDerCant], X, Y-0.3, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
}
else SendClientMessage(playerid, COLOR_NARANJA, "* /tirar [Izq/Der/Objetos]");
Streamer_Update(playerid);
return 1;
}
stock DropObjeto(ObjetoID, Cantidad, Float:X, Float:Y, Float:Z, world, interior)/* Funciуn para tirar objeto */
{
if(ObjetoID != 0)
{
new Float:rotx, Float:roty, Float:rotz;
for(new i = 0; i < sizeof(DropInfo); i++)
{
if(DropInfo[i][DropPosX] == 0.0 && DropInfo[i][DropPosY] == 0.0 && DropInfo[i][DropPosZ] == 0.0)
{
DropInfo[i][DropID] = ObjetoID;
DropInfo[i][DropCantidad] = Cantidad;
DropInfo[i][DropPosX] = X;
DropInfo[i][DropPosY] = Y;
DropInfo[i][DropPosZ] = Z;
DropInfo[i][DropVWorld] = world;
DropInfo[i][DropInterior] = interior;
rotx = 80;
roty = 0;
rotz = 0;
if(ObjetoID >= 47 && ObjetoID <= 49) rotx = 0;
if(ObjetoID >= 50 && ObjetoID <= 53) rotx = 0; Z+=0.02;
if(ObjetoID == 67) rotx = 0;
if(ObjetoID >= 75 && ObjetoID <= 79) rotx = 0;
if(ObjetoID >= 102 && ObjetoID <= 124) rotx = 0; Z+=0.02;
DropObject[i] = CreateDynamicObject(ObjetoInfo[ObjetoID][ModeloObjeto], X, Y, Z-1, rotx, roty, rotz, world);
SetTimerEx("DropObjetoTimer", 36000000, false, "i", i);
return 1;
}
}
return 1;
}
return 1;
}


