AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Script Help Please (https://forums.alliedmods.net/showthread.php?t=1888)

Nick 05-12-2004 01:09

Script Help Please
 
I've been working on this plugin for a while and I compiled it with no errors on the compiler that came with amxx, but when I tryed the online compiler I got 3 errors,

Code:
#include <amxmodx> #include <amxmisc>     public plugin_precache() { precache_sound("misc/tslap.wav") }   public admin_tslap(id,level,cid) { if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED     new name[32], name2[32] new arg[32] get_user_name(id,name2,31) new player = cmd_target(id,arg,5) if (!player)         return PLUGIN_HANDLED         new ids[2] ids[0] = player get_user_name(player,name,32)   client_cmd(0,"spk misc/tslap")     set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)     show_hudmessage(100,"%s Was Bitchslapped!!!") return PLUGIN_HANDLED } public tslap(ids[]){    set_task(0.2, "slap_player", 0, ids, 1, "a", 5)   return PLUGIN_CONTINUE } public slap_player(ids[]) { user_slap(ids[0],5) // Player is slapped with 5 Damage    return PLUGIN_CONTINUE }

If anyone could help me out that would be great Thank You.

BAILOPAN 05-12-2004 01:10

that would be because the online compiler doesn't work at all :wink:

Nick 05-12-2004 01:31

ooo never knew that thanks for the info :) any idea's why my script wont work? I tested it and nothing happens when I type amx_tslap <username> it just says couldnt find the player...

Ingram 05-12-2004 01:46

where is the init?? don't u register the plugin and the command? Also u don't read in the information, :P

and what is the point of name2? i don't think u r going to use it. (name is probably gonna be used in the hudmessage :wink: )

Nick 05-12-2004 01:47

I have a init but I just didnt post it in the code.
So the name2 is not needed and I should take it out?

Ingram 05-12-2004 01:49

ok well u might wanna look into read_argv or read_args in the includes, thats your problem then

u don't appear to be using it or wanting to use it, if your going to log the command then u will probably want it

Nick 05-12-2004 01:51

Ill give that a try 8)

Nick 05-12-2004 01:51

n e thing else you can see that is wrong?

Nick 05-12-2004 02:12

JJkiller thanks alot it worked but I got a run time error on
Code:
show_hudmessage(100,"%s Was Bitchslapped!!!")

Nick 05-12-2004 03:44

nvm everything works now :D

Ingram 05-12-2004 08:54

sry i didn't answer, i went to bed

show_hudmessage(100,"%s Was Bitchslapped!!!")

i thought u would use name there, sry

Nick 05-12-2004 11:32

np I found what I did n e way :)_


All times are GMT -4. The time now is 10:59.

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