[Tutorial] How to make a kickgun, for admins only
#7

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
Hello,

I've been asked to post this on here, Other people that can't get the Kickgun working.


This is the main script, that kicks "damageid" when you shoot them with the kickgun.
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(GetPlayerWeapon(playerid) == 33 && kickgun[playerid] == 1) {
	SendClientMessage(damagedid,COLOR_RED, "You have been kicked by The Quake Industries Shotgun for AFK.");
	Kick(damagedid);
	
	}
	return 1;
}
This is the actual kickgun script, I just put this below some other command, using strcmp.

Код:
	if(strcmp(cmd, "/kickgun", true) ==0)
	{
	    if(PlayerInfo[playerid][pAdmin] >= 1337)
	    {
			if(kickgun[playerid] == 0)
			{
				if(PlayerInfo[playerid][pKGBullets] != 0)
				{
					SafeGivePlayerWeapon(playerid, 33, 10000);
 					SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1000);
					kickgun[playerid] = 1;
					
					format(string, sizeof(string), "* %s Takes out his kickgun.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY,"* No charges in the kickgun!");
				    return 1;
				}
			}
			else
			{
			    ResetPlayerWeapons(playerid);
				SafeGivePlayerWeapon(playerid, 24, 10);
				AttachWeaponCorrectly(playerid, 23);
				kickgun[playerid] = 0;
				ClearAnimations(playerid);
				SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, PlayerInfo[playerid][pSilenSkill]);
				format(string, sizeof(string), "* %s Puts his kickgun away.", sendername);
				ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
			}
		}
	    return 1;
	}
Hope you like.
This wouldn't work and would give a few errors especially since it was copied and pasted and needs to be set up correctly. Could have at least credited me in it.

So to fix a few errors:
Firstly, you haven't referenced kickgun nor KGBullets.
SetPlayerSkillLevel wouldn't even be required as it was specific to our game mode
I would go on, however I rather just post the new version I created since the only thing you changed was the weapon that you received when using the command and the Quake industry stuff.

So yeah, I'll repost the my version as either an include or a filsterscript either today or tomorrow.
Reply


Messages In This Thread
How to make a kickgun, for admins only - by UnknownGamer - 22.07.2012, 07:07
Re: How to make a kickgun, for admins only - by Kindred - 22.07.2012, 07:29
Re: How to make a kickgun, for admins only - by newbienoob - 22.07.2012, 07:55
Re: How to make a kickgun, for admins only - by Djole1337 - 22.07.2012, 07:57
Re: How to make a kickgun, for admins only - by Rob_Maate - 22.07.2012, 16:21
Re: How to make a kickgun, for admins only - by Pinguinn - 22.07.2012, 16:52
Re: How to make a kickgun, for admins only - by XVlaDX - 06.05.2013, 17:12

Forum Jump:


Users browsing this thread: 1 Guest(s)