Raised This Month: $ Target: $400
 0% 

Help with spawn protection code!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:17   Help with spawn protection code!
Reply With Quote #1

I compiled this plugin and I got 6 errors , here they are :
Code:
error 029: invalid expression, assumed zero
error 017 : unidentified symbol "god_off"
error 017 : unidentified symbol "sID"
error 001 : expected token ";" but found "]"
error 029 : invalid expression, assumed zero
error 001 : expected token "}" but found "end of file"
Here is the plugin incase you want to check it :

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("amx_god","0.1","Peli")     register_cvar("amx_god","1")     register_event("ResetHUD","god_on","b") } public god_on( id ) {     if (get_cvar_num("amx_god") == 1)         return PLUGIN_CONTINUE         new players[32], numberofplayers, i, cur_id     get_players(players,numberofplayers)         for (i=0;i<numberofplayers;i++)     {         cur_id = players[i]         set_user_godmode(cur_id,1)     }     set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.5, 1.5, 4 )     for (i=0;i<numberofplayers;i++)       {         cur_id = players[i]     show_hudmessage(cur_id, "SPAWN PROTECTION IS ENABLED")         set_user_godmode(cur_id,1)       new sID[2]     sID[0] = id     set_task(10.0,"god_off", 0, sID, 1)     return PLUGIN_CONTINUE } public god_off( sID[] ) {     new cur_id = sID[0]     set_user_godmode(cur_id,0)     return PLUGIN_CONTINUE }

Okay thanks guys , try to help me.
Peli is offline
Send a message via MSN to Peli
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-09-2004 , 16:20  
Reply With Quote #2

Code:
public god_on( id ) 
{
the { is not closed in the plugin.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:21  
Reply With Quote #3

Thanks I new I was forgeting something easy like that in the plugin when I was writing it. Always good to have someone else check it.
Peli is offline
Send a message via MSN to Peli
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:30  
Reply With Quote #4

i think i changed a lot of your plugin, but
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("amx_god","0.1","Peli")     register_cvar("amx_god","1")     register_event("ResetHUD","god_on","b") } public god_on() {     if (get_cvar_num("amx_god") != '1')         return PLUGIN_HANDLED           new players[32], numberofplayers     get_players(players,numberofplayers)     for (new i=0;i<numberofplayers;i++)         set_user_godmode(i,1)         set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.5, 1.5, 4 )     show_hudmessage(0, "SPAWN PROTECTION IS ENABLED")         set_task(10.0,"god_off")     return PLUGIN_HANDLED } public god_off(id) {     new players[32], numberofplayers     get_players(players,numberofplayers)     for (new i=0;i<numberofplayers;i++)         set_user_godmode(id,0) }
if u decide to try that, hopefully it works
Ingram is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:32  
Reply With Quote #5

YES! Thank you JJKiller , that one gives no errors , I'll study it to try to see what I did wrong and how you fixed it , thank you both.
Peli is offline
Send a message via MSN to Peli
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:34  
Reply With Quote #6

np, glad i could help (its also good practise)
Ingram is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:36  
Reply With Quote #7

One more thing , should I use "return PLUGIN_CONTINUE" or "return PLUGIN_HANDLED" at the end of the code? I'm not sure which I should use...
Peli is offline
Send a message via MSN to Peli
Ingram
Veteran Member
Join Date: May 2004
Old 05-09-2004 , 16:57  
Reply With Quote #8

it doesn't work without it? cause i really wasn't sure
Ingram is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-09-2004 , 16:58  
Reply With Quote #9

It does but I was just wondering , I won't use it in there if it does. Thanks anyways. I'll be releasing it soon with your name on the credits and a lot more people who helped me also , this is my first plugin , I'm so happy.
Peli is offline
Send a message via MSN to Peli
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 05-09-2004 , 16:59  
Reply With Quote #10

the joy of making ur first plugin lol u gotta love the fact that you created something and other ppl willl use it
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Reply



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 10:59.


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