shape1
shape2
shape3
shape4
shape7
shape8

/hg


Dmitriy_Orell

алкоголик
Пользователь
12.04.2015
977
2
390
0
Повесить оружие за спину.

В public OnPlayerCommandText вставляем:

Код:
	if(strcmp("/hg", cmdtext, true, 10) == 0)
	{
		new weapon = GetPlayerWeapon(playerid);
		new ammo = GetPlayerAmmo(playerid);
		if(GetPVarInt(playerid,"Gun")>=1) {
			GivePlayerWeapon(playerid,GetPVarInt(playerid,"Gun"),GetPVarInt(playerid,"Ammo"));
			SendClientMessage(playerid,COLOR_WHITE,"* Вы достали свое оружие.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s забирает повешенное оружие с себя.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			StopPlayerHoldingObject(playerid);
			SetPVarInt(playerid, "Gun", 0);
			SetPVarInt(playerid, "Ammo", 0); }
		else if(weapon == 22) { // Colt.45
			SetPVarInt(playerid, "Gun", 22);
			SetPlayerHoldingObject(playerid, 346, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
			SendClientMessage(playerid,COLOR_WHITE,"* Повесили на ногу Colt 45");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Colt 45 на ногу.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,22); }
		else if(weapon == 23) { // Colt.45 с Глушителем
			SetPVarInt(playerid, "Gun", 23);
			SetPlayerHoldingObject(playerid, 347, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
			SendClientMessage(playerid,COLOR_WHITE,"* Повесили на ногу Colt 45 Silencer");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Colt 45 Silence на ногу.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,23); }
		else if(weapon == 24) { // Desert Eagle
			SetPVarInt(playerid, "Gun", 24);
			SetPlayerHoldingObject(playerid, 348, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
			SendClientMessage(playerid,COLOR_WHITE,"* Повесили на ногу Deagle");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Deagle на правую ногу.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,24); }
		else if(weapon == 25) { // Shotgun
			SetPVarInt(playerid, "Gun", 25);
			SetPlayerHoldingObject(playerid, 349, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину ShotGun");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил ShotGun за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,25); }
		else if(weapon == 28) { // UZI
			SetPVarInt(playerid, "Gun", 28);
			SetPlayerHoldingObject(playerid, 352, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили на ногу UZI");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил UZI на ногу.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,28); }
		else if(weapon == 29) { // MK5
			SetPVarInt(playerid, "Gun", 29);
			SetPlayerHoldingObject(playerid, 353, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину MP5");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил MP5 за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,29); }
		else if(weapon == 30) { // Ak47
			SetPVarInt(playerid, "Gun", 30);
			SetPlayerHoldingObject(playerid, 355, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину Ak47");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Ak47 за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,30); }
		else if(weapon == 31) { // M4A1
			SetPVarInt(playerid, "Gun", 31);
			SetPlayerHoldingObject(playerid, 356, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину M4");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил M4 за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,31); }
		else if(weapon == 32) { // Tech 9
			SetPVarInt(playerid, "Gun", 32);
			SetPlayerHoldingObject(playerid, 372, 8, 0.0, 0.0, 0.1, -100.0, 0.0, 0.0);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили на ногу Tech-9");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Tech-9 на ногу.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,32); }
		else if(weapon == 33) { // Country Rifle
			SetPVarInt(playerid, "Gun", 33);
			SetPlayerHoldingObject(playerid, 357, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину Country Rifle");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Country Rifle за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,33); }
		else if(weapon == 34) { // Sniper Rifle
			SetPVarInt(playerid, "Gun", 34);
			SetPlayerHoldingObject(playerid, 358, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину Sniper Rifle");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил Sniper Rifle за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,34); }
		else if(weapon == 35) { // RPG
			SetPVarInt(playerid, "Gun", 35);
			SetPlayerHoldingObject(playerid, 359, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину RPG");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил RPG за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,35); }
		else if(weapon == 36) { // RPG-Automatical
			SetPVarInt(playerid, "Gun", 36);
			SetPlayerHoldingObject(playerid, 360, 1, 0.200000, -0.119999, -0.059999, 0.000000, 206.000000, 0.000000, 1.000000, 1.000000, 1.000000);
			SendClientMessage(playerid,COLOR_WHITE,"* Вы повесили за спину RPG-Auto");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s повесил RPG-Auto за спину.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			SetPVarInt(playerid, "Ammo", ammo);
			RemovePlayerWeapon(playerid,36); }
		else {}
		return 1;
	}
 
Последнее редактирование модератором: