Raised This Month: $51 Target: $400
 12% 

Laser Mod v1.7


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 05:29   Re: Laser Mod v1.2
Reply With Quote #21

You didn't make all the changes, also HasFlags macross should have more tabulations in order to be arranged like all ( also Ham_Player_ResetSpeed require some tabulations in plus ).

You didn't make make the '1'.

Also i see you have lot of variables with size '33' you can make an enum and insert size with Max Players + 1, check my Heart Health to see 'how' to do that.

Also you should remove all 'stock' from all your stocks , like you done with Save and Load functions, just look all the same.

Also you should test by yourself because is your plugin and the most important: do not post the realease until you test and see by yourself everything is working.

Just copy them from here:
Code:
#define TASK_CHECK 			200020
#define TASK_KILLME 			200021
#define TASK_COUNTDOWN 			200022
#define TASK_COUNTDOWNINVIS 		200023
#define TASK_SHOWLMS 			200024

#define HasFlags(%1)        		(get_user_flags(%1) & ACCESS)

#define Ham_Player_ResetMaxSpeed 	Ham_Item_PreFrame

#define fm_cs_set_weapon_ammo(%1,%2)	set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)

#define cmx(%1) 			(sizeof(%1) - 1)
#define play_sound(%1,%2,%3) 		emit_sound(%1,CHAN_ITEM,%2,VOL_NORM,ATTN_NORM,0,%3)

#define INVALID_WEAPONS 		((1<<CSW_KNIFE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_C4))
#define SPRITE_LASER 			"sprites/lgtning.spr"

#define MAX_COLORS	 		6

const m_pPlayer = 			41
const OFFSET_LINUX_WEAPONS =		4
const m_pActiveItem =			373
const OFFSET_CLIPAMMO =			51

new const szPrefix[]  = 		"!g[LaserMod]!y:"
__________________
Project: Among Us

Last edited by Craxor; 12-24-2016 at 05:32.
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-24-2016 , 12:46   Re: Laser Mod v1.2
Reply With Quote #22

I already have tested it by myself. But others peoples can get bugs...

Quote:
Originally Posted by Craxor View Post
You didn't make all the changes, also HasFlags macross should have more tabulations in order to be arranged like all ( also Ham_Player_ResetSpeed require some tabulations in plus ).
What tabulations are u meaning?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-24-2016 at 13:51.
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 14:16   Re: Laser Mod v1.2
Reply With Quote #23

Just copy mine to be exactly like as they should be arranged.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-24-2016 , 14:27   Re: Laser Mod v1.2
Reply With Quote #24

You mean removing the ACCESS ?

PHP Code:
#define HasFlags(%1) (get_user_flags(%1) & ADMIN_CVAR) 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-24-2016 at 14:28.
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 14:32   Re: Laser Mod v1.2
Reply With Quote #25

no man , i'm talking only about indentation.

Read again my replies an try to understand them, where you can't understand ask my again.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-24-2016 , 14:36   Re: Laser Mod v1.2
Reply With Quote #26

Man, I already have readed all your replies. I'll post my new code again, if you have some edits for tell me to make, please, say it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 15:00   Re: Laser Mod v1.3
Reply With Quote #27

1. I find again some of them who are not-arranged, copy them again from here:
Code:
new const PLUGIN[] = "Laser"
new const VERSION[] =  "1.3"
new const AUTHOR[] =  "EFFx"

#define HasFlags(%1)       		(get_user_flags(%1) & ADMIN_CVAR)
#define fm_cs_set_weapon_ammo(%1,%2)	set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
#define cmx(%1) 			(sizeof(%1) - 1)
#define play_sound(%1,%2,%3) 		emit_sound(%1,CHAN_ITEM,%2,VOL_NORM,ATTN_NORM,0,%3)

const Ham:Ham_Player_ResetMaxSpeed =	Ham_Item_PreFrame
const MAX_COLORS =	 		6
const m_pPlayer = 			41
const OFFSET_LINUX_WEAPONS =		4
const m_pActiveItem =			373
const OFFSET_CLIPAMMO =			51
const TASK_CHECK =			200020
const TASK_KILLME = 			200021
const TASK_COUNTDOWN = 			200022
const TASK_COUNTDOWNINVIS = 		200023
const TASK_SHOWLMS = 			200024
const INVALID_WEAPONS = 		( (1 << CSW_KNIFE ) | ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) | ( 1 << CSW_C4 ) )
const MaxPlayers = 			32

new const SPRITE_LASER[] = 		"sprites/lgtning.spr"
new const sound_laseron[] = 		"items/nvg_on.wav"
new const sound_buy[] = 		"items/gunpickup2.wav"
new const sound_jump[] = 		"weapons/rocketfire1.wav"
new const sound_fallen[] =		"player/pl_pain4.wav"

new const szPrefix[]  = 		"!g[LaserMod]!y:"

2. open the vault in plugin_init insteand of calling plugin_cfg, anyway it is the same thing but i may prefer there.

3. About szAuthId, not like that, your variable declaration should look like that:
PHP Code:
new szAuthId[33][34
And usage:
PHP Code:
SaveLmsid 

    
get_user_authididszAuthid[id], cmxszAuthid ) ) 
    
    new 
szData[11];
    
num_to_strget_user_lm(id) , szDatacmxszData ) )

    
nvault_setnVaultSaveLMszAuthid[id], szData 


LoadLmsid 

    
get_user_authididszAuthid[id], cmxszAuthid ) ) 

    
set_user_lm(id0nvault_getnVaultSaveLMszAuthid[id] ) )

4.
Here:
PHP Code:
menu_additem(iMenu,"Orange"

You could make a const list:
PHP Code:
new const szColors[] [] = 
{
    
"Orange",
    
"Green",
    
"Blue",
    
"White",
    
"Purple",
    
"Yellow"


Then make a loop to create all the items with the items from the list:
PHP Code:
    if(is_user_alive(id))
    {
        new 
iMenu menu_create("Laser Color \w( \r/lcmenu \w)","laser_colors_handler")
        
        for( new 
sizeof szColorsi++ )
        {
            
menu_additemiMenuszColors[i] )
        }
        
        
menu_display(id,iMenu)
    } 

5. In the public laser_colors_handler(id,menu,item) at the end you're re-creating the menu once calling the public OpenLcMenu(id) at the end , better use menu_display( ) again.

6. in shot_laser(ent), you're doing that:
PHP Code:
for(new player 1;player <= iMaxPlayers;player++)
    { 
To touch al the players ids, don't do that, use get_players() ( the same problem at CheckBug() public ).

7. Make an enum also for szAuthid, lm and count downs variables, they have the same size no ?
PHP Code:
enum _:PlayerPrivateDatas
{
    
Lm,
    
CountDown,
    
CountDOwnInvis,
    
szAuthId[34]
}
new 
PrivatePlayerData[PlayerPrivateDatas][MaxPlayers+1
also szAuthId is 34 not 32.

8. If you take the user auth id steam in the client_authorized, don't do that also in Load or save functions, that's the point of szAuthId variable, to take steamid just once, not in all your publics:
PHP Code:
SaveLmsid 
{     
    new 
szData[11];
    
num_to_strget_user_lm(id) , szDatacmxszData ) )

    
nvault_setnVaultSaveLMszAuthid[id], szData 


LoadLmsid 
{  
    
set_user_lm(id0nvault_getnVaultSaveLMszAuthid[id] ) )

__________________
Project: Among Us

Last edited by Craxor; 12-24-2016 at 15:22.
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-24-2016 , 15:07   Re: Laser Mod v1.3
Reply With Quote #28

1.
PHP Code:
const Ham_Player_ResetMaxSpeed =    Ham_Item_PreFrame 
It should be #define
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Tag mismatch on line 20
Warning: Tag mismatch on line 160
Header size:           3432 bytes
Code size:            28580 bytes
Data size:            23604 bytes
Stack/heap size:      16384 bytes; estimated max. usage=781 cells (3124 bytes)
Total requirements:   72000 bytes

2 Warnings.
Done.
All things updated

8. I should do it or the 3?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 12-24-2016 at 15:14.
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 15:10   Re: Laser Mod v1.3
Reply With Quote #29

Sorry, should be like this:
PHP Code:
const Ham:Ham_Player_ResetMaxSpeed =    Ham_Item_PreFrame 
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-24-2016 , 15:15   Re: Laser Mod v1.3
Reply With Quote #30

Forgot about 3, i just posted to show you're using wrong szAuthid, should be szAuthid[id], anyway, better take in consideration 7 and 8.
__________________
Project: Among Us

Last edited by Craxor; 12-24-2016 at 15:21.
Craxor is offline
Send a message via ICQ to Craxor
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 20:22.


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