cerere modificare multijump

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
_.m!NNimaL.[;x]
Membru, skill +1
Membru, skill +1
Posts: 212
Joined: 28 Jun 2012, 12:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 13 times
Been thanked: 4 times
Contact:

30 Jul 2012, 07:09

Vreau sa-mi modificati si mie multijump cu acesta poti sari de 5 ori in sus dar eu vreau sa sari de 2 ori :)

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
	register_plugin("MultiJump","1.1","twistedeuphoria")
	register_cvar("amx_maxjumps","1")
	register_cvar("amx_mjadminonly","0")
}

public client_putinserver(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}

public client_disconnect(id)
{
	jumpnum[id] = 0
	dojump[id] = false
}

public client_PreThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
	new nbut = get_user_button(id)
	new obut = get_user_oldbutton(id)
	if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
	{
		if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
		{
			dojump[id] = true
			jumpnum[id]++
			return PLUGIN_CONTINUE
		}
	}
	if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
	{
		jumpnum[id] = 0
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_user_alive(id)) return PLUGIN_CONTINUE
	if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
	if(dojump[id] == true)
	{
		new Float:velocity[3]	
		entity_get_vector(id,EV_VEC_velocity,velocity)
		velocity[2] = random_float(265.0,285.0)
		entity_set_vector(id,EV_VEC_velocity,velocity)
		dojump[id] = false
		return PLUGIN_CONTINUE
	}
	return PLUGIN_CONTINUE
}	
Image
User avatar
Andrei.B
Fost administrator
Fost administrator
Posts: 6481
Joined: 17 Aug 2009, 08:15
Detinator Steam: Da
CS Status: Plecat pe mari si tari
Detinator server CS: Nu detin !
SteamID: andreybci94
Reputatie: Fost Membru Club eXtreamCS (o luna)
Fost Administrator
Nume anterior : bLack, Andrei,krusc
Contribuitor
Location: ConstanTa
Has thanked: 275 times
Been thanked: 556 times
Contact:

30 Jul 2012, 09:18

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
   register_plugin("MultiJump","1.1","twistedeuphoria")
   register_cvar("amx_maxjumps","2")
   register_cvar("amx_mjadminonly","0")
}

public client_putinserver(id)
{
   jumpnum[id] = 0
   dojump[id] = false
}

public client_disconnect(id)
{
   jumpnum[id] = 0
   dojump[id] = false
}

public client_PreThink(id)
{
   if(!is_user_alive(id)) return PLUGIN_CONTINUE
   if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
   new nbut = get_user_button(id)
   new obut = get_user_oldbutton(id)
   if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
   {
      if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
      {
         dojump[id] = true
         jumpnum[id]++
         return PLUGIN_CONTINUE
      }
   }
   if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
   {
      jumpnum[id] = 0
      return PLUGIN_CONTINUE
   }
   return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
   if(!is_user_alive(id)) return PLUGIN_CONTINUE
   if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
   if(dojump[id] == true)
   {
      new Float:velocity[3]   
      entity_get_vector(id,EV_VEC_velocity,velocity)
      velocity[2] = random_float(265.0,285.0)
      entity_set_vector(id,EV_VEC_velocity,velocity)
      dojump[id] = false
      return PLUGIN_CONTINUE
   }
   return PLUGIN_CONTINUE
}   

Mereu in suflet culorile ( Roş -Albastru )
Image
ImageImage
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests