23.11.2011, 23:40
(
Последний раз редактировалось Mattos; 14.09.2013 в 19:05.
)
Topic in Portuguease
Hello everybody, today I came up with the idea to "fix" a bug that occurs in the SAMP, because the game was originally designed for single player and not multiplayer, with an Include.
The SAMP has several interiors, and there are several entries in the map that provide access to these interiors.
The problem is that several entries in the map at different locations provide access to the same interior. So if a player enters a Binco store of LS and another player enters a Binco store from LV, for example, they will see eachother inside, which is not realistic.
So the include takes the position coordinates of the player (PosX, and Posy PosZ) and define, through a calculation, a virtual world.
Thus it is as if each entry, with the yellow pickup, led the player to a specific virtual world, thus making the game much more real. This ends the need for excluding these original entries of the game and create new entries with a new pickup.
Example of use
NOTE: The number of the VirtualWorld is defined by "InteriorVW(playerid)"
Many of you may wonder why I do not simply created new entries or set a random virtual world when the player enter the interior. Because the idea is just use the original entries of the game and make the players see eachother inside, if the had entered at the same location.
Testing Functionality
Use the code below to test the functionality of the Include:
Include Download
Solidfiles
Pastebin
Author
Mateus Costa de Mattos
Credits
rjjj
Gustavo_Araujo
NOTE: Do not remove the credits. Feel free to edit the Include.
Hello everybody, today I came up with the idea to "fix" a bug that occurs in the SAMP, because the game was originally designed for single player and not multiplayer, with an Include.
The SAMP has several interiors, and there are several entries in the map that provide access to these interiors.
The problem is that several entries in the map at different locations provide access to the same interior. So if a player enters a Binco store of LS and another player enters a Binco store from LV, for example, they will see eachother inside, which is not realistic.
So the include takes the position coordinates of the player (PosX, and Posy PosZ) and define, through a calculation, a virtual world.
Thus it is as if each entry, with the yellow pickup, led the player to a specific virtual world, thus making the game much more real. This ends the need for excluding these original entries of the game and create new entries with a new pickup.
Example of use
NOTE: The number of the VirtualWorld is defined by "InteriorVW(playerid)"
pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
if (newinteriorid == 0)
{
SetPlayerVirtualWorld(playerid, 0); // Will make the player go back to the 0 VW when the new interior id is 0
}
else
{
SetPlayerVirtualWorld(playerid,InteriorVW(playerid)); // Will set a certain virtual world, based on the player position when he starts entering the interior.
}
}
Testing Functionality
Use the code below to test the functionality of the Include:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) // Code from SAMP Wiki
{
if(strcmp(cmdtext, "/world", true) == 0)
{
new string[32];
format(string, sizeof(string), "Your virtual world: %d", GetPlayerVirtualWorld(playerid));
SendClientMessage(playerid,0xFFFFFFFF,string);
return 1;
}
return 0;
}
Solidfiles
Pastebin
Author
Mateus Costa de Mattos
Credits
rjjj
Gustavo_Araujo
NOTE: Do not remove the credits. Feel free to edit the Include.