AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   My vary first plugin with loads of errors (https://forums.alliedmods.net/showthread.php?t=8727)

svendude 12-23-2004 16:46

My vary first plugin with loads of errors
 
Ok, I'm trying to make a plugin where it changes 1 persons gravity (don't tell me it's already made ok, i'm trying to learn :D) but i got loads of errors. Here's the code:

Code:
/* Made by fragers (also known as carl or svendude) Use at your own risk! This is my first script so I am not responsible if this script makes your computer blow up. Author: Svendudes Version: 1.0 date started: December 23, 2004 */ #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("fun gravity","1.0","Svendude")     register_concmd("amx_gravity","funcgravity", ADMIN_BAN," : Changes the gravity of a player")     } public funcgravity(id,level,cid) {     if(!cmd_access(id,level,cid,1)) {         return PLUGIN_HANDLED         }         Float: set_user_gravity ( id, [ Float:gravity ] )         return PLUGIN_HANDLED }

I know it has something to do with the set_user_gravity line though. What is the right way to do what i'm trying to do :D (sorry if i sound mean i'm in kinda a rush

f1del1ty.oXi 12-23-2004 16:48

Scripting help forum fo a reason you know. :x

svendude 12-23-2004 17:03

THE HELL~!? I thought i did post in the scripting help :oops: :?

can an admin move it to the right spot?

:edit 1: Thank you

Geesu 12-23-2004 20:20

change Float: set_user_gravity ( id, [ Float:gravity ] )

to

set_user_gravity ( id, 0.3)

svendude 12-23-2004 20:35

no float?

Geesu 12-23-2004 20:41

Or just use this:

Code:
/* Made by fragers (also known as carl or svendude) Use at your own risk! This is my first script so I am not responsible if this script makes your computer blow up. Author: Svendudes Version: 1.0 date started: December 23, 2004 */ #include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_plugin("fun gravity","1.0","Svendude")     register_concmd("amx_gravity","funcgravity", ADMIN_BAN," : Changes the gravity of a player")     } public funcgravity(id,level,cid) {             if(!cmd_access(id,level,cid,1)){         console_print(id, "You have no access to that command")         return PLUGIN_HANDLED     }     new arg[5]     read_argv(1, arg, 4)     set_user_gravity(id, floatstr(arg))     return PLUGIN_HANDLED }

to use do like

amx_gravity 1.0 (normal)

amx_gravity 0.3

XxAvalanchexX 12-23-2004 21:00

The "You have no access to this command" is automatically printed when you use the cmd_access function.

mobytoss 12-24-2004 16:45

Ah, I had the same problem as this guy when I tried making the same plugin. I never could work out what to do :0/

I'm gonna see if I can get it working using pimpdaddy's method.


All times are GMT -4. The time now is 19:17.

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