AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   My Script Won't Compile (https://forums.alliedmods.net/showthread.php?t=3030)

Poison_Jay 06-24-2004 10:01

My Script Won't Compile
 
shieldwar.sma
Code:
/* AMXX Mod script. * * Shield War * Version Beta 1 * By: Poison_Jay * Special Thanks: Peli, Kingpin * * MSN: <a href="mailto:[email protected]">[email protected]</a> * * Commands: amx_shieldwar 1|0 * * Discription: All Players Spawn With Shield + Deagle */ #define TIME 5.0 #include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Shield War","1","Poison_Jay");     register_event("CurWeapon","shield","be","1=1")     register_cvar("amx_shieldwar","1")     register_concmd("amx_shieldwar","amx_shieldwar",ADMIN_LEVEL_B","1 = On 2 = Off") } public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)            return PLUGIN_CONTINUE                   if(get_cvar_num("amx_shieldwar")==1) {         set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )         show_hudmessage(0, "ShieldWar mode has been enabled")         new clip, ammo         new usersweapon = get_user_weapon(id,clip,ammo)         client_cmd(id, "drop")         if(usersweapon==CSW_SHIELD) {             //nothing         }         if(usersweapon==CSW_DEAGLE) {         give_item(id,"ammo_50ae")         } else {         set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )         show_hudmessage(0, "ShieldWar mode has been enabled"         give_item(id,"weapon_shield")         give_item(id,"weapon_deagle")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")         give_item(id,"ammo_50ae")          set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )          show_hudmessage(0, "ShieldWar mode has been enabled")     }     return PLUGIN_HANDLED }

shieldwar.amx using web compiler



there was nothing in it! i was like wtf?![/small]

Girthesniper 06-24-2004 11:15

Here is the following errors I get when it is atempted compile.

Code:

Small compiler 2.1.0                Copyright (c) 1997-2002, ITB CompuPhase

C:\Documents and Settings\Robert Blody\Desktop\shieldwarz.sma(24) : error 001: expected token: ",", but found "-string-"
C:\Documents and Settings\Robert Blody\Desktop\shieldwarz.sma(24 -- 27) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Robert Blody\Desktop\shieldwarz.sma(24 -- 27) : error 001: expected token: ",", but found "public"
C:\Documents and Settings\Robert Blody\Desktop\shieldwarz.sma(24 -- 28) : error 029: invalid expression, assumed zero

Might wana get on that. ;)

AssKicR 06-24-2004 11:18

here is one without the bugs, but it still won't work the way i think i want it to

Code:
/* AMXX Mod script. * * Shield War * Version Beta 1 * By: Poison_Jay * Special Thanks: Peli, Kingpin * * MSN: <a href="mailto:[email protected]">[email protected]</a> * * Commands: amx_shieldwar 1|0 * * Discription: All Players Spawn With Shield + Deagle */ #define TIME 5.0 #include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Shield War","1","Poison_Jay");     register_event("CurWeapon","shield","be","1=1")     register_cvar("amx_shieldwar","1")     register_concmd("amx_shieldwar","amx_shieldwar",ADMIN_LEVEL_B,"1 = On 2 = Off") } public shield(id) {     if(get_cvar_num("amx_shieldwar")==0)            return PLUGIN_CONTINUE                     if(get_cvar_num("amx_shieldwar")==1) {         set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )         show_hudmessage(0, "ShieldWar mode has been enabled")         new clip, ammo         new usersweapon = get_user_weapon(id,clip,ammo)         client_cmd(id, "drop")         if(usersweapon==CSW_DEAGLE) {             give_item(id,"ammo_50ae")         } else {             set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )             show_hudmessage(0,"ShieldWar mode has been enabled")             give_item(id,"weapon_shield")             give_item(id,"weapon_deagle")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             give_item(id,"ammo_50ae")             set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, TIME, 0.5, 1.5, 4 )             show_hudmessage(0, "ShieldWar mode has been enabled")         }     }     return PLUGIN_HANDLED

Poison_Jay 06-24-2004 11:25

how did u want it?

i wanted...
-SHield+deagle with ammo ^^
-restrict all other weapons

considering...
-unlimited ammos

AssKicR 06-24-2004 16:03

well then u need more code

Peli 06-24-2004 19:32

Quote:

Originally Posted by Poison_Jay
how did u want it?

i wanted...
-SHield+deagle with ammo ^^
-restrict all other weapons

considering...
-unlimited ammos

Okay , your code has : Shield+Deagle+Ammo , but it does NOT have Restriction to all other weapons or Unlimited ammo.

Girthesniper 06-24-2004 19:34

He probley wants the base plugin working. Then he will add the rest later.

Peli 06-24-2004 19:35

Yea that would be a smart idea , I sugguest saving what you have now incase you mess with some stuff and forget what you messed up so you have to start all over. :( That happened to me. Lol. :)

Poison_Jay 06-24-2004 22:50

ya i saved it already, i'm trying to look at other plugins how they do it...

So...does mine give the whole team?
does it happen every new round?

i can't test it cuz i keep getting error when i join my own game when i select the skin i want -.-''

Poison_Jay 06-24-2004 23:20

Quote:

Loaded 2 admins from file
L 06/25/2004 - 10:08:56: [AMXX] Function is not present (function "amx_shieldwar") (plugin "shieldwar.amx")
L 06/25/2004 - 10:08:56: [AMXX] Run time error 10 on line 24 (plugin "shieldwar.amx")
omfg


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

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