Raised This Month: $ Target: $400
 0% 

Gravity Plugin Help Please!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AlejandroSk
BANNED
Join Date: Nov 2008
Location: Aqui, en mi casa. Karma:
Old 01-13-2009 , 14:17   Gravity Plugin Help Please!
Reply With Quote #1

Hi , i want make a plugin that gives all players gravity for 5 seconds to hide.(at start)

PS: Im a beginner
but i failed =(

heres my code
Code:
#include <amxmodx>
#include <fakemeta_util>


public plugin_init() {
	
	register_srvcmd("grav_init", "grav_init")
	
	public "grav_init"(id)
	fm_set_user_gravity(id, 0.40)
	set_task(5.0, "remove_grav")
	if (grav_init)
		client_print(player, print_chat, "[Gravity] You have gravity for 5 seconds!")
	
	public "remove_grav"(id)
	fm_set_user_gravity(id, 1.0)
	if ("remove_grav")
		client_print(player, print_chat, "[Gravity]Your Gravity End")

And the error's
Code:
//// 5_seconds_gravity.sma
// C:\Archivos de programa\Valve\cstrike\addons\amxmodx\scripting\dede.sma(9) :
error 029: invalid expression, assumed zero
// C:\Archivos de programa\Valve\cstrike\addons\amxmodx\scripting\dede.sma(9) :
error 029: invalid expression, assumed zero
// C:\Archivos de programa\Valve\cstrike\addons\amxmodx\scripting\dede.sma(9) :
error 017: undefined symbol "id"
// C:\Archivos de programa\Valve\cstrike\addons\amxmodx\scripting\dede.sma(9) :
fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file compiled\dede.amx (compile failed).
//
// Compilation Time: 0,22 sec
// ----------------------------------------
AlejandroSk is offline
Send a message via MSN to AlejandroSk
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 01-13-2009 , 14:41   Re: Gravity Plugin Help Please!
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta_util>
 
public plugin_init() 
{
         
register_srvcmd("grav_init""grav_init")
}
 
public 
grav_init()
{         
         for( new 
133i++)
         {
                  if( 
is_user_connected(id) )
                  {
                           
fm_set_user_gravity(i0.40)
                           
client_print(iprint_chat"[Gravity] You have gravity for 5 seconds!")
                  }
         }
 
         
set_task(5.0"remove_grav")
}
 
public 
remove_grav()
{
         for( new 
133i++)
         {
                  if( 
is_user_connected(id) )
                  {
                           
fm_set_user_gravity(i1.0)
                           
client_print(playerprint_chat"[Gravity] Your Gravity End")
                  }
         }

__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-13-2009 , 14:53   Re: Gravity Plugin Help Please!
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> new bool:g_give_gravity; new bool:g_alive[33]; new g_max_clients; public plugin_init() {     register_event("ResetHUD", "EventResetHud", "be");     register_event("DeathMsg", "EventDeathMsg", "a");         register_logevent("EventRoundStart", 2, "1=Round_Start");         register_forward(FM_PlayerPreThink, "FwdPlayerPreThink");         g_max_clients = get_maxplayers(); } public client_disconnect(client) {     g_alive[client] = false; } public EventResetHud(client) {     g_alive[client] = bool:is_user_alive(client); } public EventDeathMsg() {     g_alive[read_data(2)] = false; } public EventRoundStart() {     g_give_gravity = true;         remove_task(112233);     set_task(5.0, "TaskRemoveGravity", 112233); } public FwdPlayerPreThink(client) {     if( g_give_gravity && g_alive[client] )     {         set_pev(client, pev_gravity, 0.4);     } } public TaskRemoveGravity() {     g_give_gravity = false;         for( new client = 1; client <= g_max_clients; client++ )     {         if( g_alive[client] )         {             set_pev(client, pev_gravity, 0.1);         }     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode