Little coding questions - For general minor queries 5

You can use GPCI for that but it's not reliable.
Reply

Why this is not working?
PHP Code:
#define fac_t:%0    FacType_%0

new fac_t:Gouv
Code:
warning 236: unknown parameter in substitution (incorrect #define pattern)
error 001: expected token: ";", but found "%"
Reply

Quote:
Originally Posted by Dayrion
View Post
Why this is not working?
PHP Code:
#define fac_t:%0    FacType_%0
new fac_t:Gouv
Code:
warning 236: unknown parameter in substitution (incorrect #define pattern)
error 001: expected token: ";", but found "%"
PHP Code:
MyTag:
//declarable
new MyTag:var; 
^ This is called a Tag and you cannot declare it in macros.

PHP Code:
MyPrefix::
//defineable
#define MyPrefix::%1 %1_MyPrefix 
This is not a tag.
Reply

Quote:
Originally Posted by Gammix
View Post
PHP Code:
MyTag:
//declarable
new MyTag:var; 
^ This is called a Tag and you cannot declare it in macros.

PHP Code:
MyPrefix::
//defineable
#define MyPrefix::%1 %1_MyPrefix 
This is not a tag.
Ooh. Yes, okei. I'm pretty stupid lol

Mhm, but How does foreach work? Forach has created his own tag? This tag add a new var.
Reply

Quote:
Originally Posted by Dayrion
View Post
Ooh. Yes, okei. I'm pretty stupid lol

Mhm, but How does foreach work? Forach has created his own tag? This tag add a new var.
Well if you use bracets, which will force the decelaration to be of that specific syntax everytime, can prevent this error.

If i am not wro g, this should compile:
PHP Code:
#define MyTag:%1<%2> %1@MyTag[%2]
new MyTag:var<100>; 
Reply

Alright, thanks you! +rep
Reply

I found creating a thread for this to be inappropriate, so I thought of asking this question here; I create dynamic CP with the radius of 3.0, but the thing is that even when I'm near my fucking CPs it calls the OnPlayerEnterDynamicCP while I'm not in it. Is there any solution for this fucking problem, this is pissing me off since the past week and I've seen some servers such as RWW where this shit doesn't happen.
Reply

Thanks alot Southclaw.

--
Is there any way to show a 3D text label to a player which is attached to himself? Either using YSF/ SKY or anything?
Reply

* Ali is speechless after seeing Gamer_Z's post *
(( Waiting for others to roleplay ))

I'd look more deeper into this tomorrow, gotta sleep today :P
Reply

Any technical reason why there's no GetVehicleInterior function? Ye ye, I know I can just save the interiorid to an array of vehicles whenever I set a vehicle's interior, but that's not my question. Was just curious if there was an issue in SA-MP that made the function never to be existing?
Reply

Quote:
Originally Posted by Hansrutger
Посмотреть сообщение
Any technical reason why there's no GetVehicleInterior function? Ye ye, I know I can just save the interiorid to an array of vehicles whenever I set a vehicle's interior, but that's not my question. Was just curious if there was an issue in SA-MP that made the function never to be existing?
Probably because it wasn't thought of. I don't see how anyone in here would know why except for kalcor
Reply

People tend to be smarter than me so maybe someone had a theory!
Reply

Say, a players near a house. When you're near the house, say a checkpoints set at the door. What can I use to do this BUT when you're in it, it doesn't loop and you're not being flickered with checkpoints?

Just an example of what I'm trying to get at.
Reply

Anyone knows the ID of the sound that plays on single player when you purchase a house?
I mean this: https://www.youtube.com/watch?v=qBbRd4o1suY
Reply

Hey there, I'm using XAMPP and I'm not able to connect my localhost server to the MySQL DB. Any ideas?
Reply

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Hey there, I'm using XAMPP and I'm not able to connect my localhost server to the MySQL DB. Any ideas?
What error message do you get? There's dozen of reasons that you won't be able to connect such as the mysql service isn't started, invalid username/password, ...
Reply

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Hey there, I'm using XAMPP and I'm not able to connect my localhost server to the MySQL DB. Any ideas?
Be sure Skype is closed and Apache & MySQL are actived :
Reply

Hey.
I need to save in database 8 ranks. Like, rank_1, rank_2 ... rank_8.
What is the best way to do this?
Actually ;
PHP код:
CREATE TABLE `---`.`---` ( `---INT NOT NULL AUTO_INCREMENT , `rank_1VARCHAR(35NOT NULL , `rank_2VARCHAR(35NOT NULL , `rank_3VARCHAR(35NOT NULL , `rank_4VARCHAR(35NOT NULL , `rank_5VARCHAR(35NOT NULL , `rank_6VARCHAR(35NOT NULL , `rank_7VARCHAR(35NOT NULL , `rank_8VARCHAR(35NOT NULL PRIMARY KEY (`faction_id`)) ENGINE InnoDB
Edit: Also, loading ranks is painfull :
PHP код:
PUBLIC:OnRanksLoading()
{
    new 
temporaire,
        
nbRank cache_num_rows();
    for(new 
i!= nbRanki++)
    {
        
cache_get_value_int(i"SQLID"temporaire); // SQLID
        
cache_get_value(i"rank_0"f_RankName[temporaire][0], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_1"f_RankName[temporaire][1], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_2"f_RankName[temporaire][2], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_3"f_RankName[temporaire][3], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_4"f_RankName[temporaire][4], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_5"f_RankName[temporaire][5], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_6"f_RankName[temporaire][6], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_7"f_RankName[temporaire][7], MAX_FAC_RANK_NAME);
        
cache_get_value(i"rank_8"f_RankName[temporaire][8], MAX_FAC_RANK_NAME);
    }

Reply

You only need a column per-property if things can occupy multiple.
If your ranks are only occupied by things one at a time, just use a single "rank" column and drop a number in there that represents the rank.
I'm not entirely sure what you're aiming to do though, so some more information would be good.
Reply

Alright, so ranks each ranks (min 6, max 8 ) are named by the owner. Of course, I need to save each rank's name.
rank_0 is the 0 rank's name. 1 is for 1, etc...

EDIT;
#define variable isn't considered as a constant?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)