20.01.2015, 19:29
all my codes are here:
Can anyone help me to fix it, i want this if i shoot with SD then it's taze someone
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;
}