Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Enum vectors


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-05-2018 , 14:24   [ H3LP ] Enum vectors
Reply With Quote #1

Hello, I'm getting compilation error when I do this (array sizes do not match, or destination array is too small)

Code:
enum _:eVectors {     Float:ORIGIN[3],     Float:ANGLES[3], }; public something(pPlayer) {     new stVector[eVectors];     ArrayGetArray(g_arrSpawns, random(ArraySize(g_arrSpawns)), stVector);     entity_set_vector(pPlayer, EV_VEC_origin, stVector[ORIGIN]);     entity_set_vector(pPlayer, EV_VEC_origin, stVector[ANGLES]); }

I know I can simply do this:

Code:
enum _:eVectors {     Float:ORIGIN[3],     Float:ANGLES[3], }; public something(pPlayer) {     new stVector[eVectors], Float:vecOrigin[3], Float:vecAngles[3];     ArrayGetArray(g_arrSpawns, random(ArraySize(g_arrSpawns)), stVector);     vecOrigin[0] = stVector[ORIGIN][0];     vecOrigin[1] = stVector[ORIGIN][1];     vecOrigin[2] = stVector[ORIGIN][2];     vecAngles[0] = stVector[ANGLES][0];     vecAngles[1] = stVector[ANGLES][1];     vecAngles[2] = stVector[ANGLES][2];     entity_set_vector(pPlayer, EV_VEC_origin, vecOrigin);     entity_set_vector(pPlayer, EV_VEC_origin, vecAngles); }

But I want to know if it's possible to do WITHOUT create another two vectors and add to them.
__________________









Last edited by CrazY.; 06-06-2018 at 19:54.
CrazY. 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 04:33.


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