Raised This Month: $62 Target: $400
 15% 

Compiler problem with plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IonutC69
New Member
Join Date: Apr 2021
Old 04-22-2021 , 10:56   Compiler problem with plugin
Reply With Quote #1

Quote:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#pragma semicolon 1

#define FLASH_SPEED 350.0 // viteza care o are Flash
#define HULK_GRAVITY 0.60 // gravitatea setata lui hulk ( 1.0 = 800 )
#define PREDATOR_MULTIPLY 1.8 // damage facut inmultit cu 1.5 sau cat pui.
#define ELF_INVISIBILITY 76 // ( 0 - 255 ) 2.55 este aproximativ 1% deci 76 vine cam 30% vizibil

#define PLUGIN "Clase Human"
#define VERSION "1.0"

#define kModels "models/v_knifex.mdl"

new const Models[ 4 ][ ] =
{

"", //Null
"1x1", //Flash
"2x2", //Hulk
"3x3" //Vip

}


new const MenuName[ ] = "w[BB.Freakz.Ro] rAlege-ti rasa";
new const NumeSite[ ] = "rBafta la FRAGURI!";

new bool:UserIsFlash[ 33 ];
new bool:UserIsHulk[ 33 ];
new bool:UserIsVIp[ 33 ];
new bool:UserChoosed[ 33 ];

public plugin_precache( )
{

new ModelPath[ 64 ];

for( new i = 1; i < 4; i++ )
{
formatex( ModelPath, sizeof ( ModelPath ) -1, "models/player/%s/%s.mdl", Models[ i ], Models[ i ] );
precache_model( ModelPath );

}
precache_model( kModels );
}

public plugin_cfg( ) set_cvar_float( "sv_maxspeed", FLASH_SPEED );

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );
register_clcmd( "say /rasa", "sayRace" );

RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", true );
RegisterHam( Ham_TakeDamage, "player", "Ham_PlayerTakeDamage", false );
register_event( "CurWeapon", "evCurWeapon", "be", "1=1" );
register_event( "HLTV", "evHookRoundStart", "a", "1=0", "2=0" );
}

public client_connect(id)
{
SetCl_Settings( id , 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;
UserChoosed[ id ] = false;
}

public client_disconnect(id)
{
SetCl_Settings( id, 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;
UserChoosed[ id ] = false;
}

public sayRace( id )
{
if( UserChoosed[ id ] )
{
client_print( id, print_chat, "* Ti-ai ales deja rasa runda aceasta !" );
return 1;
}
if( cs_get_user_team( id ) == CS_TEAM_CT ) MainMenu( id );

return 0;
}

public Ham_PlayerSpawnPost( id )
{
if( UserIsVIp[ id ] ) set_user_gravity( id, HULK_GRAVITY );

if( !is_user_alive( id ) || UserChoosed[ id ] ) return HAM_IGNORED;

if( UserChoosed[ id ] )
{
client_print( id, print_chat, "* Ti-ai ales deja rasa runda aceasta !" );
return HAM_IGNORED;
}

ResetUserSettings( id );
if( cs_get_user_team( id ) == CS_TEAM_CT ) MainMenu( id );

cs_reset_user_model( id );

return HAM_IGNORED;
}

public Ham_PlayerTakeDamage( id, iInflictor, iAttacker, Float:flDamage, bitsDamageType )
{

if( !iAttacker || id == iAttacker || !is_user_connected( iAttacker ) || !is_user_connected( id )
|| get_user_team( id ) == get_user_team( iAttacker )
|| !UserIsVIp[ id ] ) return HAM_IGNORED;

SetHamParamFloat( 4, flDamage * PREDATOR_MULTIPLY );

return HAM_IGNORED;
}

public evCurWeapon( id )
{
if( is_user_alive( id ) )
{

if( cs_get_user_team( id ) == CS_TEAM_CT )
{

new clip, ammo, wpnid = get_user_weapon( id, clip, ammo );

if( wpnid == CSW_KNIFE )
{

if( UserIsFlash[ id ] )
{
set_pev(id, pev_viewmodel2, kModels)
}
else if( UserIsHulk[ id ] )
{
set_pev(id, pev_viewmodel2, kModels)
}
else if( UserIsVIp[ id ] )
{

set_pev(id, pev_viewmodel2, kModels)
}
}
}

}

return 0;
}
public evHookRoundStart( )
{
new iPlayers[ 32 ];
new iPlayersNum;

get_players( iPlayers, iPlayersNum, "ch" );
for( new i = 0 ; i < iPlayersNum ; i++ )
{
UserChoosed[ iPlayers[ i ] ] = false;
}

}

public MainMenu( id )
{
new menu = menu_create( MenuName, "MainMenuHandler" );

menu_additem( menu, "PLAYERr- |ySPEED w| yDEAGLEw| yM4A1r| -", "1", 0 );
menu_additem( menu, "ADMIN r- |ySPEED w| yGRAVITY w| yDEAGLE w| yAK47r| -^n", "2", 0 );
menu_additem( menu, "V.I.P w- |rGRAVITY y| rSPEED y| rINVIZIBILITY y| rDMG X2 y| rALL WEAPONSw|-", "3", 0 );

menu_setprop( menu, MPROP_EXITNAME, NumeSite );

menu_display( id, menu, 0 );

}

/*============================================ ===========================================s= P=u=f=?*/

public MainMenuHandler( id, menu, item )
{
if( item == MENU_EXIT )
{
set_task( 0.1, "MainMenu", id );
return 1;
}

if( cs_get_user_team( id ) != CS_TEAM_CT ) return 1;

new data[ 4 ], iName[ 64 ];
new iaccess, callback;

menu_item_getinfo( menu, item, iaccess, data, 3, iName, sizeof ( iName ) -1, callback );

new key = str_to_num( data );

switch( key )
{
case 1:
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 1 );
cs_set_user_model( id, Models[ 1 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_m4a1");
cs_set_user_bpammo ( id, CSW_M4A1, 999);
return 1;
}
case 2:
{
if( get_user_flags( id ) & read_flags( "d" ) )
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 2 );
cs_set_user_model( id, Models[ 2 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_ak47");
cs_set_user_bpammo ( id, CSW_AK47, 999);
return 1;
}
else
{
MainMenu( id );
return 1;
}
}
case 3:
{
if( UserIsVip( id ) )
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 5 );
cs_set_user_model( id, Models[ 3 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
give_item(id, "weapon_usp");
cs_set_user_bpammo ( id, CSW_USP, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_m4a1");
cs_set_user_bpammo ( id, CSW_M4A1, 999);
give_item(id, "weapon_ak47");
cs_set_user_bpammo ( id, CSW_AK47, 999);
return 1;
}
else
{
MainMenu( id );
return 1;
}
}
}

return 0;
}

public GiveUserPower( id, const Class )
{

switch( Class )
{
case 1:
{

//slow hacking ?:O
SetCl_Settings( id, 1 );
set_user_maxspeed( id, FLASH_SPEED );
UserIsFlash[ id ] = true;

return 1;

}
case 2:
{
SetCl_Settings( id, 1 );
set_user_maxspeed( id, FLASH_SPEED );
set_user_gravity( id, HULK_GRAVITY );
UserIsHulk[ id ] = true;

return 1;
}
case 5:
{
//Il facem Flash
SetCl_Settings( id, 1 );

set_user_maxspeed( id, FLASH_SPEED );

//Il facem Hulk
set_user_gravity( id, HULK_GRAVITY );

//Il facem Elf
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, ELF_INVISIBILITY );

UserIsVIp[ id ] = true;
return 1;
}
}

return 0;

}

public ResetUserSettings( id )
{
if( UserIsFlash[ id ] ) set_user_maxspeed( id, 350.0 );

if( UserIsHulk[ id ] ) set_user_maxspeed( id, 350.0 );

if( UserIsVIp[ id ] )
{
set_user_maxspeed( id, 350.0 );

set_user_gravity( id, 0.60 );

set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
}


SetCl_Settings( id, 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;

}
public SetCl_Settings( id, const OnOff )
{

if( OnOff > 0 )
{
client_cmd( id, "cl_backspeed %.1f", FLASH_SPEED );
client_cmd( id, "cl_forwardspeed %.1f", FLASH_SPEED );
client_cmd( id, "cl_sidespeed %.1f", FLASH_SPEED );

return 1;

}

client_cmd( id, "cl_backspeed 400" );
client_cmd( id, "cl_forwardspeed 400" );
client_cmd( id, "cl_sidespeed 400" );

return 0;

}

stock bool:UserIsVip( id )
{

if( get_user_flags( id ) & read_flags( "a" ) )
return true;

return false;

}


ERROR COMPLIER :
Code:
textzZvy8y.sma(30) : error 001: expected token: ";", but found "new"
textzZvy8y.sma(49) : warning 217: loose indentation
textzZvy8y.sma(142) : error 017: undefined symbol "set_pev"
textzZvy8y.sma(142) : warning 215: expression has no effect
textzZvy8y.sma(142) : error 001: expected token: ";", but found ")"
textzZvy8y.sma(142) : error 029: invalid expression, assumed zero
textzZvy8y.sma(142) : fatal error 107: too many error messages on one line

Compilation aborted.
5 Errors.
IonutC69 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-22-2021 , 16:20   Re: Compiler problem with plugin
Reply With Quote #2

Appears as a decompile. Fakemeta needs included for starters.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 04-22-2021 , 19:49   Re: Compiler problem with plugin
Reply With Quote #3

Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>
#include <fakemeta>

//#pragma semicolon 1

#define FLASH_SPEED 350.0 // viteza care o are Flash
#define HULK_GRAVITY 0.60 // gravitatea setata lui hulk ( 1.0 = 800 )
#define PREDATOR_MULTIPLY 1.8 // damage facut inmultit cu 1.5 sau cat pui.
#define ELF_INVISIBILITY 76 // ( 0 - 255 ) 2.55 este aproximativ 1% deci 76 vine cam 30% vizibil

#define PLUGIN "Clase Human"
#define VERSION "1.0"

#define kModels "models/v_knifex.mdl"

new const Models[ 4 ][ ] =
{

"", //Null
"1x1", //Flash
"2x2", //Hulk
"3x3" //Vip

}


new const MenuName[ ] = "w[BB.Freakz.Ro] rAlege-ti rasa";
new const NumeSite[ ] = "rBafta la FRAGURI!";

new bool:UserIsFlash[ 33 ];
new bool:UserIsHulk[ 33 ];
new bool:UserIsVIp[ 33 ];
new bool:UserChoosed[ 33 ];

public plugin_precache( )
{

new ModelPath[ 64 ];

for( new i = 1; i < 4; i++ )
{
formatex( ModelPath, sizeof ( ModelPath ) -1, "models/player/%s/%s.mdl", Models[ i ], Models[ i ] );
precache_model( ModelPath );

}
precache_model( kModels );
}

public plugin_cfg( ) set_cvar_float( "sv_maxspeed", FLASH_SPEED );

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );
register_clcmd( "say /rasa", "sayRace" );

RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", true );
RegisterHam( Ham_TakeDamage, "player", "Ham_PlayerTakeDamage", false );
register_event( "CurWeapon", "evCurWeapon", "be", "1=1" );
register_event( "HLTV", "evHookRoundStart", "a", "1=0", "2=0" );
}

public client_connect(id)
{
SetCl_Settings( id , 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;
UserChoosed[ id ] = false;
}

public client_disconnected(id)
{
SetCl_Settings( id, 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;
UserChoosed[ id ] = false;
}

public sayRace( id )
{
if( UserChoosed[ id ] )
{
client_print( id, print_chat, "* Ti-ai ales deja rasa runda aceasta !" );
return 1;
}
if( cs_get_user_team( id ) == CS_TEAM_CT ) MainMenu( id );

return 0;
}

public Ham_PlayerSpawnPost( id )
{
if( UserIsVIp[ id ] ) set_user_gravity( id, HULK_GRAVITY );

if( !is_user_alive( id ) || UserChoosed[ id ] ) return HAM_IGNORED;

if( UserChoosed[ id ] )
{
client_print( id, print_chat, "* Ti-ai ales deja rasa runda aceasta !" );
return HAM_IGNORED;
}

ResetUserSettings( id );
if( cs_get_user_team( id ) == CS_TEAM_CT ) MainMenu( id );

cs_reset_user_model( id );

return HAM_IGNORED;
}

public Ham_PlayerTakeDamage( id, iInflictor, iAttacker, Float:flDamage, bitsDamageType )
{

if( !iAttacker || id == iAttacker || !is_user_connected( iAttacker ) || !is_user_connected( id )
|| get_user_team( id ) == get_user_team( iAttacker )
|| !UserIsVIp[ id ] ) return HAM_IGNORED;

SetHamParamFloat( 4, flDamage * PREDATOR_MULTIPLY );

return HAM_IGNORED;
}

public evCurWeapon( id )
{
if( is_user_alive( id ) )
{

if( cs_get_user_team( id ) == CS_TEAM_CT )
{

new clip, ammo, wpnid = get_user_weapon( id, clip, ammo );

if( wpnid == CSW_KNIFE )
{

if( UserIsFlash[ id ] )
{
set_pev(id, pev_viewmodel2, kModels)
}
else if( UserIsHulk[ id ] )
{
set_pev(id, pev_viewmodel2, kModels)
}
else if( UserIsVIp[ id ] )
{

set_pev(id, pev_viewmodel2, kModels)
}
}
}

}

return 0;
}
public evHookRoundStart( )
{
new iPlayers[ 32 ];
new iPlayersNum;

get_players( iPlayers, iPlayersNum, "ch" );
for( new i = 0 ; i < iPlayersNum ; i++ )
{
UserChoosed[ iPlayers[ i ] ] = false;
}

}

public MainMenu( id )
{
new menu = menu_create( MenuName, "MainMenuHandler" );

menu_additem( menu, "PLAYERr- |ySPEED w| yDEAGLEw| yM4A1r| -", "1", 0 );
menu_additem( menu, "ADMIN r- |ySPEED w| yGRAVITY w| yDEAGLE w| yAK47r| -^n", "2", 0 );
menu_additem( menu, "V.I.P w- |rGRAVITY y| rSPEED y| rINVIZIBILITY y| rDMG X2 y| rALL WEAPONSw|-", "3", 0 );

menu_setprop( menu, MPROP_EXITNAME, NumeSite );

menu_display( id, menu, 0 );

}

/*============================================ ===========================================s= P=u=f=?*/

public MainMenuHandler( id, menu, item )
{
if( item == MENU_EXIT )
{
set_task( 0.1, "MainMenu", id );
return 1;
}

if( cs_get_user_team( id ) != CS_TEAM_CT ) return 1;

new data[ 4 ], iName[ 64 ];
new iaccess, callback;

menu_item_getinfo( menu, item, iaccess, data, 3, iName, sizeof ( iName ) -1, callback );

new key = str_to_num( data );

switch( key )
{
case 1:
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 1 );
cs_set_user_model( id, Models[ 1 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_m4a1");
cs_set_user_bpammo ( id, CSW_M4A1, 999);
return 1;
}
case 2:
{
if( get_user_flags( id ) & read_flags( "d" ) )
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 2 );
cs_set_user_model( id, Models[ 2 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_ak47");
cs_set_user_bpammo ( id, CSW_AK47, 999);
return 1;
}
else
{
MainMenu( id );
return 1;
}
}
case 3:
{
if( UserIsVip( id ) )
{
UserChoosed[ id ] = true;
ResetUserSettings( id );
GiveUserPower( id, 5 );
cs_set_user_model( id, Models[ 3 ] );
give_item(id, "weapon_deagle");
cs_set_user_bpammo ( id, CSW_DEAGLE, 999);
give_item(id, "weapon_usp");
cs_set_user_bpammo ( id, CSW_USP, 999);
engclient_cmd( id, "weapon_knife" );
give_item(id, "weapon_m4a1");
cs_set_user_bpammo ( id, CSW_M4A1, 999);
give_item(id, "weapon_ak47");
cs_set_user_bpammo ( id, CSW_AK47, 999);
return 1;
}
else
{
MainMenu( id );
return 1;
}
}
}

return 0;
}

public GiveUserPower( id, const Class )
{

switch( Class )
{
case 1:
{

//slow hacking ?:O
SetCl_Settings( id, 1 );
set_user_maxspeed( id, FLASH_SPEED );
UserIsFlash[ id ] = true;

return 1;

}
case 2:
{
SetCl_Settings( id, 1 );
set_user_maxspeed( id, FLASH_SPEED );
set_user_gravity( id, HULK_GRAVITY );
UserIsHulk[ id ] = true;

return 1;
}
case 5:
{
//Il facem Flash
SetCl_Settings( id, 1 );

set_user_maxspeed( id, FLASH_SPEED );

//Il facem Hulk
set_user_gravity( id, HULK_GRAVITY );

//Il facem Elf
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, ELF_INVISIBILITY );

UserIsVIp[ id ] = true;
return 1;
}
}

return 0;

}

public ResetUserSettings( id )
{
if( UserIsFlash[ id ] ) set_user_maxspeed( id, 350.0 );

if( UserIsHulk[ id ] ) set_user_maxspeed( id, 350.0 );

if( UserIsVIp[ id ] )
{
set_user_maxspeed( id, 350.0 );

set_user_gravity( id, 0.60 );

set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 );
}


SetCl_Settings( id, 0 );
UserIsFlash[ id ] = false;
UserIsHulk[ id ] = false;
UserIsVIp[ id ] = false;

}
public SetCl_Settings( id, const OnOff )
{

if( OnOff > 0 )
{
client_cmd( id, "cl_backspeed %.1f", FLASH_SPEED );
client_cmd( id, "cl_forwardspeed %.1f", FLASH_SPEED );
client_cmd( id, "cl_sidespeed %.1f", FLASH_SPEED );

return 1;

}

client_cmd( id, "cl_backspeed 400" );
client_cmd( id, "cl_forwardspeed 400" );
client_cmd( id, "cl_sidespeed 400" );

return 0;

}

stock bool:UserIsVip( id )
{

if( get_user_flags( id ) & read_flags( "a" ) )
return true;

return false;

}

Last edited by lexzor; 04-22-2021 at 19:50.
lexzor is offline
Reply


Thread Tools
Display Modes

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 22:13.


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