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; GetPlayerWeaponData(playerid, i, weapon, ammo); 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++; } } }
LoL i didn't get anything what are you trying to say like what do you want explain a bit more
|
COMMAND:drop(playerid, params[]) {
OnWeaponDrop(playerid);
ResetPlayerWeapons(playerid);
return 1;
}
pawn Код:
|
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
|
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
|
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); the i is the slot for example. slot 2 is for pistols.
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++;
}
}
}
What do you mean sir ? you want to send weapons to another player
![]() |
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; GetPlayerWeaponData(playerid, i, weapon, ammo); if((ammo > 0 || weapon == 1) && weapon != 0) { new model = GetModel(weapon); if(model != -1) { WeaponData[playerid][i][0] = weapon; WeaponData[playerid][i][1] = ammo; OnWeaponDrop(playerid); } } } if(dropped > 0) { new radius; if(dropped < 3) radius = 1; if(dropped < 6) radius = 2; /*If you want another radius, change it here.*/ if(dropped < 9) radius = 3; if(dropped > 8) radius = 4; new Float:degree, Float:tmp; degree = 360.0 / (float(dropped)); tmp = degree; if(WeaponTimer[playerid] != -1) KillTimer(WeaponTimer[playerid]); WeaponTimer[playerid] = SetTimerEx("RemovePickups", WEAPON_RESPAWN_TIME*1000, 0, "d", playerid); for(new i=0; i<13; i++) { if((WeaponData[playerid][i][1] > 0 || WeaponData[playerid][i][0] == 1) && WeaponData[playerid][i][0] > 0) { new model = GetModel(WeaponData[playerid][i][0]); if(model != -1) { WeaponDrop[playerid][i] = CreatePickup(model, 1, x+(floatsin(degree, degrees)*radius), y+(floatcos(degree, degrees)*radius), z); degree = degree + tmp; } } } } return 1; }
Alright, it's very hard to explain but i'm trying my best here. So, I've got a filterscript that drops my weapons on death and it spawns weapon objects on the ground that are pickupable of my weapons. However I'm trying to create a command here so I could drop only one gun that spawns the object model on the ground (which are pickupable). I'm using the same script as onplayerdeath and I'm trying to convert it to a command that I could drop only one gun if I want to. But the problem is that when I type /dropgun it REMOVES one of my guns like it should be BUT it spawns pickupable object models on the ground of ALL my weapons and it won't remove all of my weapons, only one. So, I'm trying to make it like when I type /dropgun it removes only one of my guns and spawns it on the ground, not all of them.
Код:
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; GetPlayerWeaponData(playerid, i, weapon, ammo); if((ammo > 0 || weapon == 1) && weapon != 0) { new model = GetModel(weapon); if(model != -1) { WeaponData[playerid][i][0] = weapon; WeaponData[playerid][i][1] = ammo; OnWeaponDrop(playerid); } } } if(dropped > 0) { new radius; if(dropped < 3) radius = 1; if(dropped < 6) radius = 2; /*If you want another radius, change it here.*/ if(dropped < 9) radius = 3; if(dropped > 8) radius = 4; new Float:degree, Float:tmp; degree = 360.0 / (float(dropped)); tmp = degree; if(WeaponTimer[playerid] != -1) KillTimer(WeaponTimer[playerid]); WeaponTimer[playerid] = SetTimerEx("RemovePickups", WEAPON_RESPAWN_TIME*1000, 0, "d", playerid); for(new i=0; i<13; i++) { if((WeaponData[playerid][i][1] > 0 || WeaponData[playerid][i][0] == 1) && WeaponData[playerid][i][0] > 0) { new model = GetModel(WeaponData[playerid][i][0]); if(model != -1) { WeaponDrop[playerid][i] = CreatePickup(model, 1, x+(floatsin(degree, degrees)*radius), y+(floatcos(degree, degrees)*radius), z); degree = degree + tmp; } } } } return 1; } |