24.02.2014, 18:37
Hey there.
This is the part of the gamemode which makes the player able to jump twice as high and gets his health back after he falls.
Works great for player ID0 but it kills all other players on the server. The version of the server is 3.0z and the gamemode has been recompiled and all of the plugins are updated.
Thanks for any help.
rep ++
This is my code:
This is the part of the gamemode which makes the player able to jump twice as high and gets his health back after he falls.
Works great for player ID0 but it kills all other players on the server. The version of the server is 3.0z and the gamemode has been recompiled and all of the plugins are updated.
Thanks for any help.
rep ++
This is my code:
PHP код:
new Float:SaveHealth[MAX_PLAYERS];
new MordidaT[MAX_PLAYERS] = 0;
new Morda;
forward TimmerMordidas();
forward healtx();
///////////////////////////////////////////////////////
Morda = SetTimer("TimmerMordidas", 3000, 1);
///////////////////////////////////////////////////////
public TimmerMordidas()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
MordidaT[playerid] = 0;
}
}
}
///////////////////////////////////////////////////////
public healtx()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid))
{
SetPlayerHealth(playerid, SaveHealth[playerid]);
}
}
}
///////////////////////////////////////////////////////
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
if(PlayerInfo[playerid][pJeZombi] == 1)
{
if(PlayerInfo[playerid][pZombiSkill] == 4 || PlayerInfo[playerid][pZombiSkill] >= 7)
{
if(MordidaT[playerid] == 0)
{
MordidaT[playerid] = 1;
GetPlayerHealth(playerid, SaveHealth[playerid]);
new Float:x, Float:y, Float:z;
SetTimer("healtx",2000,0);
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, x ,y ,z+0.5);
}
}
else
{
ClearAnimations(playerid);
}
}
}
///////////////////////////////////////////////////////
public OnGameModeExit()
{
foreach(Player, i)
{
KillTimer(Morda);
}
}
///////////////////////////////////////////////////////