SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/05/2017, 08:17 AM   #3641
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,506
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

You can use GPCI for that but it's not reliable.
Logic_ is offline   Reply With Quote
Old 08/05/2017, 02:28 AM   #3642
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 258
Default Re: Little coding questions - For general minor queries 5

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 "%"
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 08/05/2017, 02:54 AM   #3643
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Little coding questions - For general minor queries 5

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.
__________________

Follow me on Github: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 08/05/2017, 02:57 AM   #3644
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 258
Default Re: Little coding questions - For general minor queries 5

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.
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 08/05/2017, 03:49 AM   #3645
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Little coding questions - For general minor queries 5

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>; 
__________________

Follow me on Github: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 08/05/2017, 03:11 PM   #3646
Dayrion
High-roller
 
Dayrion's Avatar
 
Join Date: Jan 2016
Location: France
Posts: 1,915
Reputation: 258
Default Re: Little coding questions - For general minor queries 5

Alright, thanks you! +rep
__________________
actor_plus - v5.0.2
I'm a goner, somebody catch my breath,
I'm a goner, somebody catch my breath
Dayrion is offline   Reply With Quote
Old 08/05/2017, 07:24 PM   #3647
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,506
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

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.
Logic_ is offline   Reply With Quote
Old 09/05/2017, 06:50 PM   #3648
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,506
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

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?

Last edited by Logic_; 09/05/2017 at 07:25 PM.
Logic_ is offline   Reply With Quote
Old 09/05/2017, 07:57 PM   #3649
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,506
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

* 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
Logic_ is offline   Reply With Quote
Old 11/05/2017, 01:38 PM   #3650
Hansrutger
Gangsta
 
Hansrutger's Avatar
 
Join Date: May 2011
Location: Sweden
Posts: 760
Reputation: 161
Default Re: Little coding questions - For general minor queries 5

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?
__________________


Hansrutger is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 1 05/10/2009 07:47 PM


All times are GMT. The time now is 07:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.