Junior Member
|
02-16-2019
, 20:41
Re: Help with FF2
|
#9
|
Quote:
Originally Posted by AnubisTF2
right, but
where in the code do you check if the player has spellType, or cooldown?
show me the block
|
Code:
public Action:OnCallForMedic(client, const String:command[], args)
{
new Float:mercpos[3];
new String:modelname[128];
if(MercState2[client] == true && IsPlayerAlive(client) && IsValidClient(client))
{
if (cooldown[client] < 1)
{
GetEntPropString(client, Prop_Data, "m_ModelName", modelname, 128);
if (spellType[client] == 1 && mana[client] >= 250) // bats
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 7));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
//cast_sound[client] = -1;
cooldown[client] = 25;
mana[client] = mana[client] - 250;
}
else if (spellType[client] == 0 && mana[client] >= 200) //fire spell
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_fire%i.mp3", GetRandomInt(1, 4));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
//cast_sound[client] = -1;
cooldown[client] = 25;
mana[client] = mana[client] - 200;
}
else if (spellType[client] == 9 && mana[client] >= 900) //Meteor spell
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 2));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
//cast_sound[client] = -1;
cooldown[client] = 75;
mana[client] = mana[client] - 900;
}
else if (spellType[client] == 10 && mana[client] >= 750) //Monoculous
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast_rare%i.mp3", GetRandomInt(1, 4));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
cooldown[client] = 45;
mana[client] = mana[client] - 750;
}
else if (spellType[client] == 2 && mana[client] >= 600) //Uber spell
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
cooldown[client] = 65;
mana[client] = mana[client] - 600;
}
else if (spellType[client] == 4 && mana[client] >= 350) // Jump
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
cooldown[client] = 15;
mana[client] = mana[client] - 350;
}
else if (spellType[client] == 5 && mana[client] >= 200) //Invis spell
{
GetClientAbsOrigin(client, mercpos);
decl String:medSound[35];
Format(medSound, sizeof(medSound), "vo/merasmus/spell_cast%i.mp3", GetRandomInt(1, 4));
EmitSoundToAll(medSound, client, _, _, _, 1.0, _, _, mercpos, _, false);
FakeClientCommand(client, "use tf_weapon_spellbook")
cooldown[client] = 15;
mana[client] = mana[client] - 200;
}
else
{
cooldown[client] = 15;
}
}
else
{
//FakeClientCommand(client, "use tf_weapon_spellbook");
return Plugin_Continue;
}
}
return Plugin_Continue;
}
|
|