Read FLOAT from file
Hello.
I have simple file with FLOAT number, with AMXX plugin I can read this (I use BLOCK_INT, because there is no BLOCK_FLOAT): PHP Code:
PHP Code:
http://firepic.org/images/2013-08/15/bl163l5xftdv.png But, this code is correct? Because I got two warnings in compilation log: Code:
// file.sma(46) : warning 2PHP Code:
PHP Code:
|
Re: Read FLOAT from file
Either remove the tag doing _:r_origin_x, or use any:r_origin_x.
|
Re: Read FLOAT from file
Thanks! I just use _:r_origin_x.
|
Re: Read FLOAT from file
2 solutions, in both you need to tag it as Float in the task callback because task index can only be an integer, else you would have to pass it as task parameter.
So : Either you declare it as integer : PHP Code:
PHP Code:
|
Re: Read FLOAT from file
I want use second (2) solution, it's works for one FLOAT number, but this is does not work with this code:
PHP Code:
PHP Code:
|
Re: Read FLOAT from file
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: Read FLOAT from file
Because set_task can't pass variables like that. You have to think a bit before doing something randomly.
What is the set_task header ? : native set_task(Float:time,const function[],id = 0,const parameter[]="",len = 0,const flags[]="" ); id, is supposed to be the Task id. parameter, is an array where you can pass any data to the callback. Here, you can do something like : set_task(10.0, "task_Announce", 12654, r_origin, sizeof r_origin ); Callback should look like : public task_Announce( taskid, data[] ) Then you can do Float:data0], Float:data[1] and Float:data[2] to retrieve value. |
Re: Read FLOAT from file
Just a little correction,
tasks callbacks look like this : When you don't pass args : PHP Code:
PHP Code:
PHP Code:
|
Re: Read FLOAT from file
My old thread :), again encountered with "tag mismatch" Warning.
This string cause "tag mismatch": PHP Code:
How to remove warning? I tried: PHP Code:
PHP Code:
|
Re: Read FLOAT from file
First off, that's not a string, it's a function. You're getting tag mismatch because the second parameter is the team, which is tagged with CsTeams. 2 is an untagged integer, so you either have to use CsTeams:2 or the correct value (CS_TEAM_CT?). The third param is also wrong, it's for setting the player's model and it's tagged with CsInternalModel.
Code:
CS_DONTCHANGE PHP Code:
|
| All times are GMT -4. The time now is 15:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.