24.03.2010, 14:38
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.
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; }