Raised This Month: $32 Target: $400
 8% 

Solved [CS GO] problem with Enum


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 01-13-2019 , 06:46   [CS GO] problem with Enum
Reply With Quote #1

hi guys!
i need Enum new syntax for this cod:
PHP Code:
#pragma newdecls required

enum Premios
{
    
String:Nombre[64],
    
precio,
    
quien
}

    
int GetSizeArrayPremiosClon GetArraySize(array_premios_clon);
    
int[] Items = new int[GetSizeArrayPremiosClon][Premios]; // error 
thank you

Last edited by Dr.Mohammad; 01-16-2019 at 15:07.
Dr.Mohammad is offline
arcticx2
Senior Member
Join Date: Nov 2011
Old 01-13-2019 , 08:46   Re: [CS GO] problem with Enum
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=244092

maybe google first , then use search option from the forum , then if there were no luck finding it then post it :-? sounds good right ?
arcticx2 is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 01-14-2019 , 07:23   Re: [CS GO] problem with Enum
Reply With Quote #3

Quote:
Originally Posted by Dr.Mohammad View Post
hi guys!
i need Enum new syntax for this cod:
PHP Code:
#pragma newdecls required

enum Premios
{
    
String:Nombre[64],
    
precio,
    
quien
}

    
int GetSizeArrayPremiosClon GetArraySize(array_premios_clon);
    
int[] Items = new int[GetSizeArrayPremiosClon][Premios]; // error 
thank you
I do not think that you can convert this code to new syntax easily, but you can try to use enum structs for that

Last edited by impossible_cc; 01-14-2019 at 07:23.
impossible_cc is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-14-2019 , 08:59   Re: [CS GO] problem with Enum
Reply With Quote #4

PHP Code:
#pragma newdecls required

enum struct Premios
{
    
char Nombre[65];
    
int precio// int or char ???
    
int quien // int or char ???
}

    
Premios[] Items = new Premios[array_premios_clon.Length]; // error 
I don't know if you can create a dynamic struct.
__________________
Ilusion9 is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 01-14-2019 , 12:42   Re: [CS GO] problem with Enum
Reply With Quote #5

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
#pragma newdecls required

enum struct Premios
{
    
char Nombre[65];
    
int precio// int or char ???
    
int quien // int or char ???
}

    
Premios[] Items = new Premios[array_premios_clon.Length]; // error 
I don't know if you can create a dynamic struct.
Quote:
Originally Posted by impossible_cc View Post
I do not think that you can convert this code to new syntax easily, but you can try to use enum structs for that
thank you.
can you see this links and fix??
1.https://github.com/Franc1sco/Franug-...ilbreak.sp#L27
HTML Code:
enum struct Premios
{
	char Nombre[65];
	int precio, // int or char ???
	int quien // int or char ???
}
2.https://github.com/Franc1sco/Franug-...lbreak.sp#L268
HTML Code:
Premios[] Items = new Premios[array_premios_clon.Length]; // error

Last edited by Dr.Mohammad; 01-14-2019 at 12:43.
Dr.Mohammad is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 01-15-2019 , 17:50   Re: [CS GO] problem with Enum
Reply With Quote #6

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
    Premios[] Items = new Premios[array_premios_clon.Length]; // error 
I don't know if you can create a dynamic struct.
I hope you can, otherwise it's broken, or at least weird.


Quote:
Originally Posted by Dr.Mohammad View Post
thank you.
can you see this links and fix??
1.https://github.com/Franc1sco/Franug-...ilbreak.sp#L27
HTML Code:
enum struct Premios
{
	char Nombre[65];
	int precio, // int or char ???
	int quien // int or char ???
}
2.https://github.com/Franc1sco/Franug-...lbreak.sp#L268
HTML Code:
Premios[] Items = new Premios[array_premios_clon.Length]; // error
If no one will do that, I will have free time in about 20-22 h and I will help you with that.
impossible_cc is offline
Dr.Mohammad
Senior Member
Join Date: Jan 2016
Location: CSGO Servers
Old 01-16-2019 , 03:38   Re: [CS GO] problem with Enum
Reply With Quote #7

Quote:
Originally Posted by impossible_cc View Post
I hope you can, otherwise it's broken, or at least weird.



If no one will do that, I will have free time in about 20-22 h and I will help you with that.
thank you for your time.i waiting...

Dr.Mohammad is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 01-16-2019 , 08:21   Re: [CS GO] problem with Enum
Reply With Quote #8

I'm a bit confused with one thing,

We have this
PHP Code:
Menu menus[MAXPLAYERS+1]; 
then I do this and I get tag mismatch warning
PHP Code:
menus[i] = INVALID_HANDLE
So I did that, hope it's okay.
PHP Code:
menus[i] = view_as<Menu>(INVALID_HANDLE); 
That would be alright for me, BUT with the code below I dont get any warnings..
PHP Code:
if(menus[i] != INVALID_HANDLE
            {
                
delete menus[i];
            } 

Last edited by impossible_cc; 01-16-2019 at 09:31.
impossible_cc is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-16-2019 , 09:07   Re: [CS GO] problem with Enum
Reply With Quote #9

PHP Code:
Menu menus[MAXPLAYERS+1];

menus[client] = null// use null instead of INVALID_HANDLE

if (menus[client] != null)
{
      
delete menus[client];

__________________
Ilusion9 is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 01-16-2019 , 09:31   Re: [CS GO] problem with Enum
Reply With Quote #10

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:
Menu menus[MAXPLAYERS+1];

menus[client] = null// use null instead of INVALID_HANDLE

if (menus[client] != null)
{
      
delete menus[client];

Thanks
impossible_cc 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 04:52.


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