[HELP] remove weapon
#1

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;
  }
Reply
#2

Is your server laggy? Or are you using any timers which could mix this up?
Reply
#3

No timer, When you doin' the command, it's remove look at the line
GivePlayerWeapon(playerid, weapon, 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)