Raised This Month: $ Target: $400
 0% 

What's wrong with my code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
vermillioN25
Member
Join Date: Apr 2009
Location: Brazil
Old 08-07-2009 , 01:06   What's wrong with my code?
Reply With Quote #1

Hi. I'm trying to create a new Jailmod. A JailMod that works and its free. But I'm new at pawn/amx scripting, and I really don't know what to do. How it should be?

Description: At the start of the round, I wanted to check if the player are CT. If yes, then give him M4A1, etc... If not, then strip weapons and give a knife. And at the end of the round, it will strip weapons and give a knife

Here is my code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "JailMod"
#define VERSION "1.0"
#define AUTHOR "elemeNt;"

new amx_gamename

enum CsTeams 
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T 1,
    
CS_TEAM_CT 2,
    
CS_TEAM_SPECTATOR 3
};


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
    
amx_gamename register_cvar"amx_gamename""JailMod 1.0" ); 
    
register_logevent("logevent_round_end"2"1=Round_End")  
    
}

public 
event_new_round()
{
    if (
CS_GET_USER_TEAM == 2)
    {
        
strip_user_weapons (id)
        
give_item(id,"weapon_m4a1")
        
give_item(id,"ammo_556nato")
        
give_item(id,"ammo_556nato")
        
give_item(id,"ammo_556nato")
        
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")
        
give_item(id,"ammo_50ae")
        
give_item(id,"ammo_50ae")
        
give_item(id,"weapon_knife")
        
give_item(id,"weapon_hegrenade")
    }
    else
    {
        
strip_user_weapons (id)
        
give_item(id,"weapon_knife")
    }
    return 
PLUGIN_CONTINUE
}

public 
logevent_round_end()
{
        
strip_user_weapons (id)
        
give_item(id,"weapon_knife")

And I'm getting this errors:

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

//// jailmod.sma
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
14) : warning 201: redefinition of constant/macro (symbol "CsTeams")
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
32) : error 017: undefined symbol "CS_GET_USER_TEAM"
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
34) : error 017: undefined symbol "id"
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
35) : error 017: undefined symbol "id"
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
35) : warning 215: expression has no effect
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
35) : error 001: expected token: ";", but found ")"
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
35) : error 029: invalid expression, assumed zero
// C:\Program Files\Valve\HLServer\cstrike\addons\amxmodx\s cripting\jailmod.sma(
35) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file compiled\jailmod.amx (compile failed).
//
// Compilation Time: 0,11 sec
// ----------------------------------------
NOTE: This is my first try. Please, don't humiliate me, I'm learning it.
__________________

Last edited by vermillioN25; 08-07-2009 at 01:14.
vermillioN25 is offline
 



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 18:24.


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