02.01.2013, 21:20
Quote:
Well, I'm trying to make it like when I type /dropgun it'd remove my weapon + spawn an object on the ground which are pickupable. This happens when I use my script to /dropgun. It spawns objects on the ground of all my weapons but only removes one. I'm trying to create it like when you use /dropgun it removes your gun and ONLY spawns one object on the ground. http://i.imgur.com/qsTr3.png
|
pawn Код:
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); the i is the slot for example. slot 2 is for pistols.
pawn Код:
command(dropgun, playerid, params[])
{
new GunID = GetPlayerWeapon(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
RemovePlayerWeapon(playerid, GunID);
RemovePickups(playerid);
new Float:x, Float:y, Float:z, dropped;
GetPlayerPos(playerid,x,y,z);
for(new i=0; i<13; i++)
{
new weapon, ammo;
weapon = GetPlayerWeapon(playerid);
ammo = GetPlayerAmmo(playerid);
if((ammo > 0 || weapon == 1) && weapon != 0)
{
new model = GetModel(weapon);
if(model != -1)
{
WeaponData[playerid][i][0] = weapon;
WeaponData[playerid][i][1] = ammo;
dropped++;
}
}
}