tazer help
#1

Hello.

At now if i type /tazer i get silent pistol and if i shoot anyone then it just damage people not taze, but if i hit people with my hand then it taze

COde:

Код:
COMMAND:tazer(playerid, params[])
{
	new string[128];
	if(PlayerLoggedIn[playerid] == true)
	{
		if(KasutajaInfo[playerid][Grupeering] == 1 || KasutajaInfo[playerid][Grupeering] == 9)
		{
			if(Tazer[playerid] == 0)
			{
				Tazer[playerid] = 1;
				GivePlayerWeapon(playerid, 23, 65500);
				format(string, sizeof(string), "* %s vхtab vццlt vдlja tazeri",RPN(playerid));
				SendEmotion(playerid, string);
			}
			else if(Tazer[playerid] == 1)
			{
				Tazer[playerid] = 0;
				SetPlayerAmmo(playerid, 23, 0);
				format(string, sizeof(string), "* %s paneb tazeri vццle tagasi",RPN(playerid));
				SendEmotion(playerid, string);
			}
		}
		else KasutusText(playerid, "~r~VIGA: ~b~Sul ei ole tazerit");
	}
	else KasutusText(playerid, "~r~VIGA: ~b~Sa ei ole veel sisse loginud");
	return 1;
}
Reply
#2

You must add an animation once the targetid is struck.
Reply
#3

To start off with just having a command then shooting someone isn't just going to cut the butter, You need to control it with 'OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)', and check there using something like 'if(hitid != INVALID_PLAYER_ID)'. And another thing is it IS NOT 'tazer' its 'taser'.
Reply
#4

umh, i dont understand, maybe anyone can help me? Send me PM..
Reply
#5

Anyone please?
Reply
#6

all my codes are here:
PHP код:
forward TazerTimer(playerid
PHP код:
new Tazer[MAX_PLAYERS]; 
PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloatamountweaponid)
{
    new 
string[128];
    if(
KasutajaInfo[playerid][Grupeering] == || KasutajaInfo[playerid][Grupeering] == 9)
    {
        if(
Tazer[playerid] == && weaponid == 0)
        {
            
format(stringsizeof(string), "* %s laseb %s'i tazeriga kхhtu"RPN(playerid),RPN(damagedid));
            
SendEmotion(playeridstring);
            
TogglePlayerControllable(damagedidfalse);
            
GameTextForPlayer(damagedid"~r~Sa said Tazeriga kхhtu!"15000,6);
            
SetTimerEx("TazerTimer"15000false"i"damagedid);
        }
    }
    new 
Float:Armor;
    
GetPlayerArmour(damagedidArmor);
    if(
damagedid != INVALID_PLAYER_ID)
    {
        if(
weaponid != 0)
        {
            if(
amount >= 8)
            {
                if(
Armor <= 0)
                {
                    if(
KasutajaInfo[damagedid][Grupeering] != 8)
                    {
                        if(
KasutajaInfo[damagedid][JooksebVerd] == 0)
                        {
                            
KasutajaInfo[damagedid][JooksebVerd] = 1;
                            
format(stringsizeof(string), "* %s saab vigastada ja hakkab verd jooksma",RPN(damagedid));
                            
SendEmotion(damagedidstring);
                        }
                    }
                }
            }
        }
    }
    return 
1;

PHP код:
public TazerTimer(playerid)
{
    
TogglePlayerControllable(playeridtrue);
    return 
1;

PHP код:
COMMAND:tazer(playeridparams[])
{
    new 
string[128];
    if(
PlayerLoggedIn[playerid] == true)
    {
        if(
KasutajaInfo[playerid][Grupeering] == || KasutajaInfo[playerid][Grupeering] == 9)
        {
            if(
Tazer[playerid] == 0)
            {
                
Tazer[playerid] = 1;
                
GivePlayerWeapon(playerid2365500);
                
format(stringsizeof(string), "* %s vхtab vццlt vдlja tazeri",RPN(playerid));
                
SendEmotion(playeridstring);
            }
            else if(
Tazer[playerid] == 1)
            {
                
Tazer[playerid] = 0;
                
SetPlayerAmmo(playerid230);
                
format(stringsizeof(string), "* %s paneb tazeri vццle tagasi",RPN(playerid));
                
SendEmotion(playeridstring);
            }
        }
        else 
KasutusText(playerid"~r~VIGA: ~b~Sul ei ole tazerit");
    }
    else 
KasutusText(playerid"~r~VIGA: ~b~Sa ei ole veel sisse loginud");
    return 
1;

Can anyone help me to fix it, i want this if i shoot with SD then it's taze someone
Reply
#7

this cmd work 100%100

Код:
CMD:tazer(playerid, params[])
{
	if(HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "   You cannot do this while being in the Hunger Games Event!");
    #if defined zombiemode
	if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
	#endif
	if(IsACop(playerid))
	{
		new string[128];
		if(PlayerInfo[playerid][pConnectHours] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");

		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
			return 1;
		}

		if(GetPVarInt(playerid, "IsInArena") >= 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
			return 1;
		}
		if(GetPVarInt( playerid, "EventToken") != 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
			return 1;
		}
		if(PlayerCuffedTime[playerid] > 0)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}
		if(GetPVarInt(playerid, "Injured") == 1)
		{
			SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
			return 1;
		}

		if(PlayerInfo[playerid][pJailTime] > 0)
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
			return 1;
		}
		if(PlayerCuffed[playerid] >= 1) {
			SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
			return 1;
		}
		if(PlayerInfo[playerid][pHasTazer] < 1)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "You do not have a tazer!");
		    return 1;
		}

		if(pTazer{playerid} == 0)
		{
			pTazerReplace{playerid} = PlayerInfo[playerid][pGuns][2];
			if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
			format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			GivePlayerValidWeapon(playerid, 23, 60000);
			pTazer{playerid} = 1;
		}
		else
		{
			RemovePlayerWeapon(playerid, 23);
			GivePlayerValidWeapon(playerid, pTazerReplace{playerid}, 60000);
			format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
			ProxDetector(4.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			pTazer{playerid} = 0;
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not a law enforcement officer!");
		return 1;
	}
	return 1;
}
Reply
#8

It's just command for tazer?

But i need this, if i shoot someone with SD then it taze him
Reply
#9

Sorry, but anyone know how to mix these two commands?

PHP код:
COMMAND:pmasin(playeridparams[])
{
    if(
PlayerLoggedIn[playerid] == true)
    {
        if(
KasutajaInfo[playerid][Grupeering] == 1)
        {
            if(
IsPlayerInRangeOfPoint(playerid,10.0,1560.4456,-1694.7061,5.8970))
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                    if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 596 || 523 || 560 || 599 || 490 || 497)
                     {
                        new 
vehicleid GetPlayerVehicleID(playerid);
                        
RepairVehicle(vehicleid);
                    }
                else 
SendClientMessage(playeridCOLOR_GREY"Sa pead olema politsei masinas!");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"Sa pead olema mingis masinas!");
            }
            else 
SendClientMessage(playeridCOLOR_GREY"Sa ei ole хiges kohas!");
        }
        else 
SendClientMessage(playeridCOLOR_GREY"Sa pole politsei!");
    }
    else 
SendClientMessage(playeridCOLOR_GREY"VIGA: Sa ei ole veel sisse loginud");
    return 
1;
}
COMMAND:mmasin(playeridparams[])
{
    if(
PlayerLoggedIn[playerid] == true)
    {
        if(
KasutajaInfo[playerid][Grupeering] == 8)
        {
            if(
IsPlayerInRangeOfPoint(playerid,10.0,1736.3340,-2058.4368,13.5856))
            {
                if(
IsPlayerInAnyVehicle(playerid))
                {
                    if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 530 || 525)
                    {
                         new 
vehicleid GetPlayerVehicleID(playerid);
                         
RepairVehicle(vehicleid);
                    }
                    else 
SendClientMessage(playeridCOLOR_GREY"Sa pead olema mehaaniku masinas!");
                }
                else 
SendClientMessage(playeridCOLOR_GREY"Sa pead olema mingis masinas!");
            }
            else 
SendClientMessage(playeridCOLOR_GREY"Sa pole хiges kohas!");
        }
        else 
SendClientMessage(playeridCOLOR_GREY"Sa pole mehaanik!");
    }
    else 
SendClientMessage(playeridCOLOR_GREY"VIGA: Sa ei ole sisse loginud");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)