tazer help -
b00m112 - 19.01.2015
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;
}
Re: tazer help -
ChromeAmazing - 19.01.2015
You must add an animation once the targetid is struck.
Re: tazer help -
zT KiNgKoNg - 19.01.2015
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'.
Re: tazer help -
b00m112 - 19.01.2015
umh, i dont understand, maybe anyone can help me? Send me PM..
Re: tazer help -
b00m112 - 19.01.2015
Anyone please?
Re: tazer help -
b00m112 - 20.01.2015
all my codes are here:
PHP код:
forward TazerTimer(playerid)
PHP код:
new Tazer[MAX_PLAYERS];
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
new string[128];
if(KasutajaInfo[playerid][Grupeering] == 1 || KasutajaInfo[playerid][Grupeering] == 9)
{
if(Tazer[playerid] == 1 && weaponid == 0)
{
format(string, sizeof(string), "* %s laseb %s'i tazeriga kхhtu", RPN(playerid),RPN(damagedid));
SendEmotion(playerid, string);
TogglePlayerControllable(damagedid, false);
GameTextForPlayer(damagedid, "~r~Sa said Tazeriga kхhtu!", 15000,6);
SetTimerEx("TazerTimer", 15000, false, "i", damagedid);
}
}
new Float:Armor;
GetPlayerArmour(damagedid, Armor);
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(string, sizeof(string), "* %s saab vigastada ja hakkab verd jooksma",RPN(damagedid));
SendEmotion(damagedid, string);
}
}
}
}
}
}
return 1;
}
PHP код:
public TazerTimer(playerid)
{
TogglePlayerControllable(playerid, true);
return 1;
}
PHP код:
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;
}
Can anyone help me to fix it, i want this if i shoot with SD then it's taze someone
Re: tazer help -
Trevor Gin - 20.01.2015
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;
}
Re: tazer help -
b00m112 - 21.01.2015
It's just command for tazer?
But i need this, if i shoot someone with SD then it taze him
Re: tazer help -
b00m112 - 21.01.2015
Sorry, but anyone know how to mix these two commands?
PHP код:
COMMAND:pmasin(playerid, params[])
{
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(playerid, COLOR_GREY, "Sa pead olema politsei masinas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa pead olema mingis masinas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa ei ole хiges kohas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa pole politsei!");
}
else SendClientMessage(playerid, COLOR_GREY, "VIGA: Sa ei ole veel sisse loginud");
return 1;
}
COMMAND:mmasin(playerid, params[])
{
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(playerid, COLOR_GREY, "Sa pead olema mehaaniku masinas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa pead olema mingis masinas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa pole хiges kohas!");
}
else SendClientMessage(playerid, COLOR_GREY, "Sa pole mehaanik!");
}
else SendClientMessage(playerid, COLOR_GREY, "VIGA: Sa ei ole sisse loginud");
return 1;
}