[HELP] remove weapon - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] remove weapon (
/showthread.php?tid=136283)
[HELP] remove weapon -
Ro[X]y - 24.03.2010
I did command like the FS, you can tie your weapon on your back.
but I have some problem , it's takes few minutes until he remove your weapon.
Код:
if(strcmp(cmd, "/tieweapon", true) == 0 || strcmp(cmd, "/tw", true) == 0)
{
if(UsingTieng[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY,"You already have something on your back");
return 1;
}
new weapon = GetPlayerWeapon(playerid);
if(weapon == 30 || weapon == 31 || weapon == 33 || weapon == 34)
{
new model;
new ammo = GetPlayerAmmo(playerid);
new wtext[64];
if(weapon == 30) { wtext = "AK-47"; model = 355; }
else if(weapon == 31) { wtext = "M4"; model = 356; }
else if(weapon == 33) { wtext = "Cuntgun"; model = 357; }
else if(weapon == 34) { wtext = "Sniper Rifle"; model = 358; }
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string, sizeof(string), "* %s ties his %s on his back.", sendername,wtext);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
WeaponObj[playerid] = CreateObject(model,0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
AttachObjectToPlayer(WeaponObj[playerid],playerid, -0.1, -0.25, 0.5, 0, -300, 0);
GivePlayerWeapon(playerid, weapon, 0);
weapontiengID[playerid] = weapon;
weapontiengAmmo[playerid] = ammo;
UsingTieng[playerid] = 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You cannot tie this weapon!");
}
return 1;
}
Re: [HELP] remove weapon -
Jay420 - 24.03.2010
Is your server laggy? Or are you using any timers which could mix this up?
Re: [HELP] remove weapon -
Ro[X]y - 24.03.2010
No timer, When you doin' the command, it's remove look at the line
GivePlayerWeapon(playerid, weapon, 0);