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(gTeam[playerid] == TEAM_ZOMBIES)
{
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;
}
dcmd_setnemesis(playerid,params[])
{
if(PlayerInfo[playerid][Level] >= 6) return SendClientMessage(playerid,red,"{FFFFFF}ERROR: {29FF0D}Necesitas ser {FFFFFF}Administrador nivel 6 {29FF0D}para usar este comando");
if(!sscanf(params, "r", params[0])) return SendClientMessage(playerid, -1 ,"Uso: /setnemesis [ID] ");
SetPlayerHealth(playerid,10000);
GivePlayerWeapon(playerid,35,100);
return 1;
}
dcmd_sethealth(playerid,params[]) {
{
if(PlayerInfo[playerid][Level] >= 3) return SendClientMessage(playerid,-1,"Necesitas level3");
{
new vida;
if(sscanf(params, "df", playerid, vida)) return SendClientMessage(playerid, -1, "USO: /sethealth[id] [vida]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Usuario offline");
SetPlayerHealth(playerid, vida);
}
}
return 1;
}
dcmd_setarmour(playerid,params[]) {
{
if(PlayerInfo[playerid][Level] >= 3) return SendClientMessage(playerid,-1,"Necesitas level3");
{
new chaleco;
if(sscanf(params, "df", playerid, chaleco)) return SendClientMessage(playerid, -1, "USO: /sethealth[id] [vida]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Usuario offline");
SetPlayerArmour(playerid, chaleco);
}
}
return 1;
}
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;
}
dcmd_setnemesis(playerid,params[])
{
if(PlayerInfo[playerid][Level] >= 6) return SendClientMessage(playerid,red,"{FFFFFF}ERROR: {29FF0D}Necesitas ser {FFFFFF}Administrador nivel 6 {29FF0D}para usar este comando");
if(!sscanf(params, "r", params[0])) return SendClientMessage(playerid, -1 ,"Uso: /setnemesis [ID] ");
SetPlayerHealth(params[0],10000);
GivePlayerWeapon(params[0],35,100);
return 1;
}
if(PlayerInfo[playerid][Level] < 6) return SendClientMessage(playerid,red,"{FFFFFF}ERROR: {29FF0D}Necesitas ser {FFFFFF}Administrador nivel 6 {29FF0D}para usar este comando");
dcmd_setnemesis(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 6) return SendClientMessage(playerid,red,"{FFFFFF}ERROR: {29FF0D}Necesitas ser {FFFFFF}Administrador nivel 6 {29FF0D}para usar este comando"); //cambia por la variable de tu equipo
{
if(!sscanf(params, "r", params[0]))
{
SetPlayerHealth(params[0],10000);
GivePlayerWeapon(params[0],35,100);
}
else SendClientMessage(playerid, -1 ,"Uso: /setnemesis [ID] ");
}
return 1;
}
Richard, sabes, me parece que veo algo mal en tu comando, ya que si la variable de level del usuario es 6 o mбs, no dejara que use el comando.
Yo creo que serнa asн: pawn Код:
|