AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Little error to a code (https://forums.alliedmods.net/showthread.php?t=146972)

NucL3ra 01-03-2011 17:46

Little error to a code
 
I'm getting this error and I think I'm too tired to see where it does come from.....
Code:

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// 1.sma
// D:\Jocuri\Steam\steamapps\nuc_l_ear\counter-strike\cstrike\addons\amxmodx\scr
ipting\1.sma(19 -- 20) : error 006: must be assigned to an array
//
// 1 Error.
// Could not locate output file compiled\1.amx (compile failed).
//
// Compilation Time: 0.06 sec
// ----------------------------------------

Press enter to exit ...

-----------------------------------------

PHP Code:

#include <amxmodx>
#include <colorchat>
#include <fakemeta>

new GodMod[33]


public 
plugin_init()
{
    
register_plugin("Godmode","0.1","nucLeaR")

    
register_clcmd("say /godmode","GodMode")
    
register_clcmd("say /god","GodMode")
    
register_clcmd("say .god","GodMode")
}

public 
GodMode(id)
{
    
GodMod[id] = ( GodMod[id] == ) ? "0" "1"
    
set_pev(idpev_takedamageGodMod[id] == "DAMAGE_NO" "DAMAGE_AIM")
    
ColorChat(idGREEN"[XJ]^x03 God Mode %s"GodMod[id] ? "On" "Off")
    
    return 
PLUGIN_HANDLED



joaquimandrade 01-03-2011 17:48

Re: Little error to a code
 
instead of

PHP Code:

    GodMod[id] = ( GodMod[id] == ) ? "0" "1" 





PHP Code:

    GodMod[id] = !GodMod[id



or

PHP Code:

    GodMod[id] = ( GodMod[id] == ) ? 



NucL3ra 01-03-2011 17:51

Re: Little error to a code
 
Oh yeah, thanks -,- :)

NucL3ra 01-03-2011 17:57

Re: Little error to a code
 
It compiles but the god mode doesn't work... where did i screw up this time ?

And sorry for double-post.

ConnorMcLeod 01-03-2011 18:00

Re: Little error to a code
 
Use get_user_godmode and set_user_godmode.

Seriously, you release a kz plugin and you pass strings as values for takedamage...

NucL3ra 01-03-2011 18:04

Re: Little error to a code
 
Thanks for your feedback.


All times are GMT -4. The time now is 02:12.

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