AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with spawn protection code! (https://forums.alliedmods.net/showthread.php?t=1819)

Peli 05-09-2004 16:17

Help with spawn protection code!
 
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. :)

kingpin 05-09-2004 16:20

Code:

public god_on( id )
{

the { is not closed in the plugin.

Peli 05-09-2004 16:21

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. :)

Ingram 05-09-2004 16:30

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

Peli 05-09-2004 16:32

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. :)

Ingram 05-09-2004 16:34

np, glad i could help :D (its also good practise)

Peli 05-09-2004 16:36

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...

Ingram 05-09-2004 16:57

it doesn't work without it? cause i really wasn't sure

Peli 05-09-2004 16:58

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. :)

kingpin 05-09-2004 16:59

the joy of making ur first plugin :) lol u gotta love the fact that you created something and other ppl willl use it :)

Peli 05-09-2004 17:02

Lol , I never thought about that , I should make it say "THIS PLUGIN IS MINE MINE MINE!!!" instead of "SPAWN PROTECTION IS ENABLED".
just kidding... :)

Ingram 05-09-2004 17:03

lol if u want too, idc if my name is on the credits, i hardly did anything for u anyway. That was like <5 minutes of work.

kingpin 05-09-2004 17:04

hahahahah, wold be funny to watch an admin be like wth? hey man this plugin keeps talkin bout some guy named peli.... lol

Ingram 05-09-2004 17:08

wow, we might as well exchange IMs with each other, we r already having a convo in here (17 emails recieved since i logged on to the forums)

and peli if u do do that, make it so it only sends the messages to ppl who aren't admins, the admins may never know

Peli 05-09-2004 17:12

Lol , I was just joking , but I will add you guys in the credits , becuase 1 - it is a very short plugin 2- any help recieved is help to be thankful for. :)

Peli 05-09-2004 19:19

Can someone test this in there server , it has been compiled with no errors , I just don't have my server stuff installed or even steam right now sorry. It would be great if one of u could tell me if it was working on your server , I just don't want anything to get in the way when I release it. Thanks again. :)


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

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