SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 17/08/2017, 12:09 PM   #11
denNorske
Gangsta
 
denNorske's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 722
Reputation: 49
Default Re: How To..

I say it again, I was in your server, i tried a various of shops. Most of them works, however many of them have the wrong interior id set.

Go through them and make sure you're using the correct interiors for each shop.
__________________
OBJECT PARTITIONER
Ever wondered how to split up maps easily from one file? Check: Online Map Object Partitioner (Click)
[Filterscript] Circle Speedo: http://forum.sa-mp.com/showthread.php?p=3861785

You have the people that asks for rep, and those who doesn't like it at all:


Server Trailer: https://www.youtube.com/watch?v=jSKhbMFvAUs
denNorske is offline   Reply With Quote
Old 17/08/2017, 12:58 PM   #12
FuNkYTheGreat
Huge Clucker
 
FuNkYTheGreat's Avatar
 
Join Date: Jun 2016
Location: Pakistan.
Posts: 259
Reputation: 91
Default Re: How To..

These are the wrong way, wait i'll explain what you've to do this to avoid the bug,
It's causing because you will be making checkpoints in -1 world, [ -1 = for all world ] , so it doesn't even work if you get's the player interior and then put him in that burger shot
Try this code,
Code:
new Burger1EN,Burger1EX;
// don't use those variables they are very much slow use these instead

then create them like this
Code:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size,69, interiorid = -1, playerid = -1, Float:distance = 100.0);
I put 69 there, because it's the world and now this checkpoint will only be in world 69,
and in the exit cp you can rather also use -1 world as it wont conflict because its not used for multi-purpose.
now in OnPlayerEnterDynamicCP, use
Code:
  if(pickupid == Burger1EN)
    {
        SetPlayerPos(playerid, 2363.6062,2071.2256,10.8203); /// the pos of your interior
        SetPlayerInterior(playerid, 69); //the interior that in which the player come's
        SetPlayerVirtualWorld(playerid, 5); // the world that we put in the create dynamic cp
    }
    if(pickupid == Burger1EX)
    {
        SetPlayerPos(playerid, 2469.3982,2034.7217,11.0625); // all above
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 5);
    }

Last edited by FuNkYTheGreat; 17/08/2017 at 02:31 PM.
FuNkYTheGreat is offline   Reply With Quote
Old 17/08/2017, 01:46 PM   #13
KushalD
Little Clucker
 
KushalD's Avatar
 
Join Date: Jul 2017
Location: India
Posts: 14
Reputation: 0
Default Re: How To..

What is multiple interiors by the way?? can anyone explain me?
KushalD is offline   Reply With Quote
Old 17/08/2017, 01:50 PM   #14
FuNkYTheGreat
Huge Clucker
 
FuNkYTheGreat's Avatar
 
Join Date: Jun 2016
Location: Pakistan.
Posts: 259
Reputation: 91
Default Re: How To..

by MULTI-INTERIORS he meant that using a interior various times, as there's only a interior of burger shot, so he want to ask that whats the way to use it multiple-time,
He wants to develop a CnR server.
FuNkYTheGreat is offline   Reply With Quote
Old 17/08/2017, 01:54 PM   #15
denNorske
Gangsta
 
denNorske's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 722
Reputation: 49
Default Re: How To..

Quote:
Originally Posted by FuNkYTheGreat View Post
These are the wrong way, wait i'll explain what you've to do this to avoid the bug,
It's causing because you will be making checkpoints in -1 world, [ -1 = for all world ] , so it doesn't even work if you get's the player interior and then put him in that burger shot
Try this code,
Code:
new Burger1EN,Burger1EX;
// don't use those variables they are very much slow use these instead

then create them like this
Code:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size,69, interiorid = -1, playerid = -1, Float:distance = 100.0);
I put 69 there, because it's the world and now this checkpoint will only be in world 69,
and in the exit cp you can rather also use -1 world as it wont conflict because its not used for multi-purpose.
now in OnPlayerEnterDynamicCP, use
Code:
  if(pickupid == Burger1EN)
    {
        SetPlayerPos(playerid, 2363.6062,2071.2256,10.8203); /// the pos of your interior
        SetPlayerInterior(playerid, 69); // the world that we put in the create dynamic cp
        SetPlayerVirtualWorld(playerid, 5); // the interior of the shop
    }
    if(pickupid == Burger1EX)
    {
        SetPlayerPos(playerid, 2469.3982,2034.7217,11.0625); // all above
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 5);
    }
Interiors are not virtual worlds, the samp interiors depend that you're in the same interior ID as the shop is.

If the burger shop is located in interior 7, you need to be in the same interior.
A different virtual world just gives the ability to not be in the same "world" as the other players, but in the same interior.

The problem I noticed when i joined the server was that the positions was right, but the interiors weren't set according to what the shops were, so everything was transparent, except for the close interiors in that interior id.
I bet the same problem happens when you exit the interiors - the interior id is not set back to 0, as the world is not properly visible.

Also Funky: If you use -1 in the syntax, the players will be able to see the checkpoint no matter which worlds they are inside. I bet that is what he want, not limiting it to your example "69".
If he wants multiple people in different worlds, in the same interior - he should use different virtual worlds, right?
__________________
OBJECT PARTITIONER
Ever wondered how to split up maps easily from one file? Check: Online Map Object Partitioner (Click)
[Filterscript] Circle Speedo: http://forum.sa-mp.com/showthread.php?p=3861785

You have the people that asks for rep, and those who doesn't like it at all:


Server Trailer: https://www.youtube.com/watch?v=jSKhbMFvAUs
denNorske is offline   Reply With Quote
Old 17/08/2017, 02:34 PM   #16
FuNkYTheGreat
Huge Clucker
 
FuNkYTheGreat's Avatar
 
Join Date: Jun 2016
Location: Pakistan.
Posts: 259
Reputation: 91
Default Re: How To..

Quote:
Interiors are not virtual worlds, the samp interiors depend that you're in the same interior ID as the shop is.

If the burger shop is located in interior 7, you need to be in the same interior.
A different virtual world just gives the ability to not be in the same "world" as the other players, but in the same interior.

The problem I noticed when i joined the server was that the positions was right, but the interiors weren't set according to what the shops were, so everything was transparent, except for the close interiors in that interior id.
I bet the same problem happens when you exit the interiors - the interior id is not set back to 0, as the world is not properly visible.

Also Funky: If you use -1 in the syntax, the players will be able to see the checkpoint no matter which worlds they are inside. I bet that is what he want, not limiting it to your example "69".
If he wants multiple people in different worlds, in the same interior - he should use different virtual worlds, right?
Actually you '' mis-spell or '' mis-understood ''
Actually the problem he's getting is the confliction of the checkpoints which is causing like this,
He's creating a checkpoint in -1 world means every world, But he's using these checkpoints two times, as he's making the checkpoint in every world 2 times as there's 2 burger shops so there would be 2 exit checkpoints, both in -1 means every world, both at the same location , Understand?
So we are making the checkpoint on 69 world and you've to make the other checkpoint in other world,
Now there ain't be 2 checkpoints in a same world/interior/location,
It's Fixed.
FuNkYTheGreat is offline   Reply With Quote
Old 17/08/2017, 08:55 PM   #17
Man43
Big Clucker
 
Man43's Avatar
 
Join Date: Feb 2017
Posts: 196
Reputation: 0
Default Re: How To..

Quote:
Originally Posted by FuNkYTheGreat View Post
These are the wrong way, wait i'll explain what you've to do this to avoid the bug,
It's causing because you will be making checkpoints in -1 world, [ -1 = for all world ] , so it doesn't even work if you get's the player interior and then put him in that burger shot
Try this code,
Code:
new Burger1EN,Burger1EX;
// don't use those variables they are very much slow use these instead

then create them like this
Code:
CreateDynamicCP(Float:x, Float:y, Float:z, Float:size,69, interiorid = -1, playerid = -1, Float:distance = 100.0);
I put 69 there, because it's the world and now this checkpoint will only be in world 69,
and in the exit cp you can rather also use -1 world as it wont conflict because its not used for multi-purpose.
now in OnPlayerEnterDynamicCP, use
Code:
  if(pickupid == Burger1EN)
    {
        SetPlayerPos(playerid, 2363.6062,2071.2256,10.8203); /// the pos of your interior
        SetPlayerInterior(playerid, 69); //the interior that in which the player come's
        SetPlayerVirtualWorld(playerid, 5); // the world that we put in the create dynamic cp
    }
    if(pickupid == Burger1EX)
    {
        SetPlayerPos(playerid, 2469.3982,2034.7217,11.0625); // all above
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 5);
    }
Why did need me to create a CP And im using a pickup??
Man43 is offline   Reply With Quote
Old 17/08/2017, 10:46 PM   #18
Paulice
Gangsta
 
Join Date: Jul 2017
Posts: 500
Reputation: 44
Default Re: How To..

This section should honestly only be for people that know how to script but yet still need help..
Paulice is offline   Reply With Quote
Old 19/08/2017, 09:34 AM   #19
denNorske
Gangsta
 
denNorske's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 722
Reputation: 49
Default Re: How To..

Quote:
Originally Posted by FuNkYTheGreat View Post
Actually you '' mis-spell or '' mis-understood ''
Actually the problem he's getting is the confliction of the checkpoints which is causing like this,
He's creating a checkpoint in -1 world means every world, But he's using these checkpoints two times, as he's making the checkpoint in every world 2 times as there's 2 burger shops so there would be 2 exit checkpoints, both in -1 means every world, both at the same location , Understand?
So we are making the checkpoint on 69 world and you've to make the other checkpoint in other world,
Now there ain't be 2 checkpoints in a same world/interior/location,
It's Fixed.
My bad, I didn't realise it was this way.

I see what you mean now
__________________
OBJECT PARTITIONER
Ever wondered how to split up maps easily from one file? Check: Online Map Object Partitioner (Click)
[Filterscript] Circle Speedo: http://forum.sa-mp.com/showthread.php?p=3861785

You have the people that asks for rep, and those who doesn't like it at all:


Server Trailer: https://www.youtube.com/watch?v=jSKhbMFvAUs
denNorske 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



All times are GMT. The time now is 12:15 PM.


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