27.11.2012, 19:27
Hey im making that i can do /dump guns, so all the weapons the player are holding will be shown on the floor, but when i do /dump guns it will only drop the weapon that im holding, can you please help me with this?
CODE:
CODE:
pawn Код:
if(strcmp(tmp,"guns",true)==0)
{
new gunID = GetPlayerWeapon(playerid);
new gunAmmo = GetPlayerAmmo(playerid);
if(gunID != 0 && gunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < sizeof(ObjCoords); a++)
{
if(ObjCoords[a][0] == 0.0)
{
f = a;
break;
}
}
for(new i = 1;i < 12;i++)
{
if(PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You cannot drop weapons in this faction !");
return 1;
}
if(PlayerInfo[playerid][pMember] == 2)
{
SendClientMessage(playerid, COLOR_GREY, " You cannot drop weapons in this faction !");
return 1;
}
if(PlayerInfo[playerid][pMember] == 3)
{
SendClientMessage(playerid, COLOR_GREY, " You cannot drop weapons in this faction !");
return 1;
}
if(gunID == pGun[playerid][i])
{
if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_GRAD1, "You can not throw weapons at the moment, try back later!!");
new WeaponNames[25];
new buffer[100];
GetWeaponName(gunID, WeaponNames, sizeof(WeaponNames));
format(buffer, sizeof(buffer), "You threw away your all your weapons");
SendClientMessage(playerid, COLOR_GRAD1, buffer);
format(string,sizeof(string),"* %s throws their weapons away",Name(playerid));
ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
pGun[playerid][i] = 0;
SetPlayerWeapons(playerid);
SendClientMessage(playerid, COLOR_GREY, " You dropped your weapons onto the ground.");
ReduceTime[playerid] = 5;
DropWeapons(gunID,gunAmmo,X,Y,Z,GetPlayerVirtualWorld(playerid),playerid);
return 1;
}
}
}
}