28.08.2011, 18:15
Hi , i want to Make a Players in the Team 1 for an exemple , Making A MegaJump
thank you
thank you
new PlayerJustJumped[MAX_PLAYERS];
#define TimeNeededForJump 4000 //adjust this for ur needs
//OnPlayerConnect
PlayerJustJumped[playerid]=0;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_JUMP)
{
if(gTeam[playerid]==1)//if player is a member of team1
{
if(PlayerJustJumped[playerid]==0)//do this so the player cant abuse this jump
{
SetPlayerVelocity(playerid,0.0,0.0,5);//the higher this last value is the higher the jump
PlayerJustJumped[playerid]=1;
SetTimerEx("HighJumpResetter",TimeNeededForJump,false,"i",playerid);
}
}
else if(gTeam[playerid]==2)
{
//further teams...
}
}
return 1;
}
//somewhere else outside of a callback
forward HighJumpResetter(playerid);
public HighJumpResetter(playerid)
{
PlayerJustJumped[playerid]=0;
return 1;
}
forward HighJumpResetter(playerid);
public HighJumpResetter(playerid)
{
PlayerJustJumped[playerid]=0;
return 1;
}