SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Gamemode Scripts

Reply
 
Thread Tools Display Modes
Old 31/01/2020, 10:01 PM   #1001
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 822
Reputation: 197
Default Re: South Central Roleplay 0.20

Quote:
Originally Posted by Xlithan View Post
I have a question. Why can't you have 2 entrances for the same interior? If you enter through 1 entrance, you can't exit from the other. Little bit annoying. Is there a way around this?
I'm not sure but, doesn't SC:RP have a backdoor system?
__________________
Continuous Deathmatch
cuber is offline   Reply With Quote
Old 31/01/2020, 10:01 PM   #1002
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 400
Reputation: 35
Default Re: South Central Roleplay 0.20

Quote:
Originally Posted by iConvict View Post
100 pages
Damn, I can remember when it was first released. I've learned a lot from this script mostly formatting my code right. Everyone appreciates a clean code in every programming language.

And yeah...
Thanks for publishing it which was sadly caused by an unfortunate chain of events but at least people like me learned some stuff.

Cheers.

And yeah Emmet is the boss haha wonder if hes still coding.
Runn3R is offline   Reply With Quote
Old 31/01/2020, 10:10 PM   #1003
Xlithan
Big Clucker
 
Join Date: May 2012
Posts: 59
Reputation: 10
Default Re: South Central Roleplay 0.20

Quote:
Originally Posted by cuber View Post
I'm not sure but, doesn't SC:RP have a backdoor system?
No. I'm going to have to try and edit the script somehow. The way entrances work in this script is different to what I've seen before. When you go into an entrance, it's sets Entrance_Inside(playerid) which I believe is the Entrance ID value. So when you try to exit, it checks if you're near the Interior point of that specific Entrance, so when you press F and try to exit at a different Entrance ID's interior, it won't work. A way around this could be to check every Entrance's interior point, and then just check to make sure you're in the same VW.

If I can figure it out I'll post the script here so that anybody using this can do the same.
Xlithan is offline   Reply With Quote
Old 31/01/2020, 10:17 PM   #1004
cuber
Gangsta
 
cuber's Avatar
 
Join Date: Oct 2016
Posts: 822
Reputation: 197
Default Re: South Central Roleplay 0.20

Quote:
Originally Posted by Runn3R View Post
Damn, I can remember when it was first released. I've learned a lot from this script mostly formatting my code right. Everyone appreciates a clean code in every programming language.

And yeah...
Thanks for publishing it which was sadly caused by an unfortunate chain of events but at least people like me learned some stuff.

Cheers.

And yeah Emmet is the boss haha wonder if hes still coding.
This is gold ^.

@Xlithan - Good luck man.
__________________
Continuous Deathmatch
cuber is offline   Reply With Quote
Old 01/02/2020, 01:38 AM   #1005
Xlithan
Big Clucker
 
Join Date: May 2012
Posts: 59
Reputation: 10
Default Re: South Central Roleplay 0.20

Find Entrance_Nearest procedure. Under that procedure add:

Code:
Exit_Nearest(playerid)
{
    for (new i = 0; i != MAX_ENTRANCES; i ++) if (EntranceData[i][entranceExists] && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[i][entranceInt][0], EntranceData[i][entranceInt][1], EntranceData[i][entranceInt][2]))
	{

		if (GetPlayerInterior(playerid) == EntranceData[i][entranceInterior] && GetPlayerVirtualWorld(playerid) == EntranceData[i][entranceWorld]) {
			return i;
		}
	}
	return -1;
}
Find the following line of code:

Code:
if ((id = Entrance_Inside(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]))
Comment out that If Statement and then under that section, add the following:

Code:
		if ((id = Exit_Nearest(playerid)) != -1 && IsPlayerInRangeOfPoint(playerid, 2.5, EntranceData[id][entranceInt][0], EntranceData[id][entranceInt][1], EntranceData[id][entranceInt][2]))
	    {
	        if (EntranceData[id][entranceCustom])
				SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]);

			else
			    SetPlayerPosEx(playerid, EntranceData[id][entrancePos][0], EntranceData[id][entrancePos][1], EntranceData[id][entrancePos][2]);

			SetPlayerFacingAngle(playerid, EntranceData[id][entrancePos][3] - 180.0);

			SetPlayerInterior(playerid, EntranceData[id][entranceExterior]);
			SetPlayerVirtualWorld(playerid, EntranceData[id][entranceExteriorVW]);

			SetCameraBehindPlayer(playerid);
			PlayerData[playerid][pEntrance] = Entrance_GetLink(playerid);
			return 1;
	    }
This should work. There's probably a better way to simplify this, but this is what works for me.
Xlithan 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 06:36 AM.


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