New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Colshape polygon #424
add Colshape polygon #424
Conversation
Please also convert the vector2_t[] to a |
i mean in the cpp code. Not via params. |
you mean only in server.cpp and not in server.h? |
you need to create a std vector array from the c array for the altv api call. And you need to do that in the cpp code. |
runtime/src/altv-c-api/server.cpp
Outdated
@@ -180,6 +181,19 @@ alt::IColShape* Server_CreateColShapeRectangle(alt::ICore* server, float x1, flo | |||
return server->CreateColShapeRectangle(x1, y1, x2, y2, z).Get(); | |||
} | |||
|
|||
alt::IColShape* Server_CreateColShapePolygon(alt::ICore* server, float minZ, float maxZ, vector2_t points[]) { | |||
std::vector<alt::Vector2f> convertedPoints(sizeof(points)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of sizeof i recommend also adding a parameter for pointsSize to make it more secure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im completely new to cpp thanks for your tips :) i try to implement this with 878972f
Ty |
No description provided.