Raised This Month: $ Target: $400
 0% 

Solved set_lights in cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 06-28-2020 , 23:48   Re: set_lights in cvar
Reply With Quote #1

Yes, that is, what i want.

PHP Code:
new lights[2];
get_pcvar_string(g_lightslights2); 
So, get_pcvar_string works like this ye? I understood this command otherwise.


Thank you for help!
chickez is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-29-2020 , 02:51   Re: set_lights in cvar
Reply With Quote #2

Well because it was a letter it needs to have a string, everything you want to know is here.
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-29-2020 , 04:01   Re: set_lights in cvar
Reply With Quote #3

Quote:
Originally Posted by chickez View Post
Yes, that is, what i want.

PHP Code:
new lights[2];
get_pcvar_string(g_lightslights2); 
So, get_pcvar_string works like this ye? I understood this command otherwise.

Thank you for help!
This looks like a potential buffer overflow. Use charsmax to ensure the proper size is passed and to avoid hardcoding.
__________________

Last edited by HamletEagle; 06-29-2020 at 04:01.
HamletEagle is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 06-30-2020 , 06:20   Re: set_lights in cvar
Reply With Quote #4

Ye, it's 1.8.2, the latest.

Quote:
Originally Posted by HamletEagle View Post
This looks like a potential buffer overflow. Use charsmax to ensure the proper size is passed and to avoid hardcoding.
Charsmax inside the get_pcvar_string()?

PHP Code:
public setServerLights() 
{
    new 
lights[];
    
get_pcvar_string(g_lightslightscharsmax(2));
    
set_lights(lights);

Can I write it like this?
chickez is offline
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 17:09.


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