How to convert "const String:var[]" to new syntax
Just started using smlib, following function:
Code:
stock Client_HasWeapon(client, const String:className[]) Code:
public bool has_weapon(const char[] weapon) { |
Re: How to convert "const String:var[]" to new syntax
const char[] className should work fine unless you have a mistake some where else in the code that you're not posting.
|
Re: How to convert "const String:var[]" to new syntax
What's the declaration of "that"
|
Re: How to convert "const String:var[]" to new syntax
Code:
return Client_HasWeapon(view_as<int>(that), weapon); |
Re: How to convert "const String:var[]" to new syntax
they're* asking what is that is that being initialized to
|
Re: How to convert "const String:var[]" to new syntax
Quote:
WildCard65's advice would make OP realize that that is in fact not an int therefore throw a "tag mismatch" warning, and mine was to reference to that as in int. |
Re: How to convert "const String:var[]" to new syntax
Quote:
|
Re: How to convert "const String:var[]" to new syntax
Looks like smlib's function isn't returning a bool while your method is.
|
Re: How to convert "const String:var[]" to new syntax
Quote:
https://github.com/bcserv/smlib/blob...ents.inc#L1358 |
Re: How to convert "const String:var[]" to new syntax
For reference, I had the following code:
Code:
#define that view_as<int>(this) |
Re: How to convert "const String:var[]" to new syntax
Seems dumb, Client_HasWeapon works with a client index, why are you converting what ever variable from what it's defined as to int?
|
Re: How to convert "const String:var[]" to new syntax
Quote:
Quote:
|
Re: How to convert "const String:var[]" to new syntax
Quote:
|
Re: How to convert "const String:var[]" to new syntax
I've fixed the return tag in the repo. You're very welcome to create a pull request next time you find a bug!
|
Re: How to convert "const String:var[]" to new syntax
Ah, nice @Peace-Maker! I must admit I didn't as I thought pull requests didn't seem to be being reviewed at the moment (e.g. 39, 45).
|
Re: How to convert "const String:var[]" to new syntax
Those two add something game specific in two different ways and it wasn't decided how to handle game stocks yet.
|
All times are GMT -4. The time now is 19:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.