20.01.2015, 20:19
pawn Код:
new es_zombie[MAX_PLAYERS]:
//___________________comando o donde veas conveniente
es_zombie[playerid] = 1;
//____________________________________________________
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
if(gTeam[playerid] == TEAM_MUTANTES) return SendClientMessage(playerid,COLOR_ROJO,"Solo saltan alto los mutantes");
new Float:SuperJump[3];
GetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]);
SetPlayerVelocity(playerid, SuperJump[0], SuperJump[1], SuperJump[2]+5);
return 1;
}
if(newkeys & KEY_HANDBRAKE)
{
if(es_zombie[playerid])//si tiene 1 se aplica.
{
if(GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 0)
{
new victimid = GetClosestPlayer(playerid);
if(IsPlayerConnected(victimid))
{
if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
{
new Float:health;
GetPlayerHealth(victimid, health);
SetPlayerHealth(victimid, health - 10.0);
SetPlayerScore(playerid,(GetPlayerScore(playerid))+1);
GameTextForPlayer(victimid, "~r~Te muerden -10 hp", 1000, 5);
GameTextForPlayer(playerid, "~r~ +1 score mordida ", 1000, 5);
ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 0, 0);
PlayerPlaySound(victimid,1190,0,0,0);
return 1;
}
}
}
}
}
return 1;
}