SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/07/2019, 06:46 PM   #1
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 157
Reputation: 3
Default Dynamic Area Problem

Hey!

I'm kinda stuck with this and cannot proceed because I dont understand why it doesnt work the way I wanted.

I got this in my script for loading certain area

PHP Code:
VelocityInfoDM[VeloID][Object] = CreateDynamicObjectEx(19298VelocityInfoDM[VeloID][posX], VelocityInfoDM[VeloID][posY], VelocityInfoDM[VeloID][posZ], 0.00.00.0STREAMER_OBJECT_SD100.0DMWorlds);
CreateDynamicSphereEx(VelocityInfoDM[VeloID][posX], VelocityInfoDM[VeloID][posY], VelocityInfoDM[VeloID][posZ], 10.0DMWorlds, { -});

Streamer_SetIntData(STREAMER_TYPE_AREAiE_STREAMER_EXTRA_ID3);
                    
Streamer_SetFloatData(STREAMER_TYPE_AREAiE_STREAMER_Xx);
Streamer_SetFloatData(STREAMER_TYPE_AREAiE_STREAMER_Xy);
Streamer_SetFloatData(STREAMER_TYPE_AREAiE_STREAMER_Xz); 
then I got

PHP Code:
public OnPlayerEnterDynamicArea(playeridareaid)
{
      new 
kind Streamer_GetIntData(STREAMER_TYPE_AREAareaidE_STREAMER_EXTRA_ID);

      switch(
kind)
     {
           case 
3:
           {
                new 
Float:xFloat:yFloat:z;
                
                
Streamer_GetFloatData(STREAMER_TYPE_AREAareaidE_STREAMER_Xx);
            
Streamer_GetFloatData(STREAMER_TYPE_AREAareaidE_STREAMER_Yy);
                
Streamer_GetFloatData(STREAMER_TYPE_AREAareaidE_STREAMER_Zz);
            
                
SetVehicleVelocity(pVeh[playerid], xyz);
                
                new 
str[128];
                
format(strsizeof(str), "[DEBUG] Velocity Info = X: %f | Y: %f | Z: %f"xyz);
                
SendClientMessage(playeridCOLOR_GREENstr);

                
SendClientMessage(playerid, -1"Velo Taken !");    
           }
     }


But for some reason when I reach this area, it does not recognize it.. what could be an issue ?
NoteND is offline   Reply With Quote
Old 21/07/2019, 08:41 AM   #2
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,019
Reputation: 115
Default Re: Dynamic Area Problem

print the value of kind and check if its really returning 3 as you are using it in your switch.
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS is offline   Reply With Quote
Old 21/07/2019, 07:39 PM   #3
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 157
Reputation: 3
Default Re: Dynamic Area Problem

Quote:
Originally Posted by GTLS View Post
print the value of kind and check if its really returning 3 as you are using it in your switch.
Done.. it doesnt return any kind, seems like area is not even there or Streamer_SetIntData does not work properly
NoteND is offline   Reply With Quote
Old 22/07/2019, 06:01 PM   #4
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,019
Reputation: 115
Default Re: Dynamic Area Problem

Use GetDynamicAreaType(areaid) - https://github.com/samp-incognito/sa...Natives-(Areas) to get the Area Kind may its that what you want?

Or if its not the dynamic area kind of Streamer, whats the Kind value supposed to return?
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS is offline   Reply With Quote
Old 22/07/2019, 06:29 PM   #5
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 157
Reputation: 3
Default Re: Dynamic Area Problem

Quote:
Originally Posted by GTLS View Post
Use GetDynamicAreaType(areaid) - https://github.com/samp-incognito/sa...Natives-(Areas) to get the Area Kind may its that what you want?

Or if its not the dynamic area kind of Streamer, whats the Kind value supposed to return?
As you can see from this line

PHP Code:
Streamer_SetIntData(STREAMER_TYPE_AREAiE_STREAMER_EXTRA_ID3); 
and

PHP Code:
kind Streamer_GetIntData(STREAMER_TYPE_AREAareaidE_STREAMER_EXTRA_ID); 
kind is basically a number that I set as "E_STREAMER_EXTRA_ID" which in this case is number "3".
NoteND is offline   Reply With Quote
Old 23/07/2019, 02:17 PM   #6
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,019
Reputation: 115
Default Re: Dynamic Area Problem

Did you tried using E_STREAMER_AREA_ID instead of EXTRA ID?

Also, try checking if " i " is valid dynamic area or not. If I is not valid dynamic area, we can think about something from that perspective. Just add

Code:
if(IsValidDynamicArea(i)) printf("Valid");
And see if it prints valid or not. I think there is some problem setting the value.
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS 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
Dynamic area's jasperschellekens Scripting Help 2 01/06/2019 10:52 AM
Dynamic Area theralio Scripting Help 2 08/12/2018 01:22 AM
Dynamic area problem MRM Scripting Help 1 03/08/2018 02:58 PM
Подсчет Dynamic Area Filippow Русский/Russian 2 08/04/2014 08:34 AM
Dynamic Area Ph0eniX Scripting Help 5 23/01/2014 03:20 PM


All times are GMT. The time now is 10:19 PM.


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