Why does this fall through the sky - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why does this fall through the sky (
/showthread.php?tid=340898)
Why does this fall through the sky -
Scripter12345 - 09.05.2012
Well when i enter a house i fall from the sky sometimes under the map
Please Help Me Please
pawn Код:
if(newkeys == KEY_CROUCH)
{
for(new i = 0; i < MAX_HOUSES;i++)//Looping threw all houses.
{
new pickupid;
if(pickupid == HouseEnter[i])//Checking if the checkpoint id corresponds to one of the house interiors
{
new pName[24];//Creating the new var for the players name
GetPlayerName(playerid,pName,24);//Storing the players name
if(HInfo[i][Owned] == 1 && strcmp(HInfo[i][Owner],pName) == 0)//String comparing between the players name and the house owners name, to check if they match.
{
SetPVarInt(playerid,"PlayersInteriorHouse",GetPlayerInterior(playerid));//Storing, so later we can reset it back
SetPVarInt(playerid,"PlayerVirtualWorldHouse",GetPlayerVirtualWorld(playerid));//Storing, so later we can reset it back
SetPlayerPos(playerid,446.7281,507.0475,1001.4195);//Setting the players position.
SetPlayerInterior(playerid,12);//Setting the players interior.
SetPlayerVirtualWorld(playerid,HInfo[i][VirtualWorld]);//Preventing players from different houses, finding each other.
PlayerInHouseID[playerid] = i;
}
if(HInfo[i][Owned] == 1 && strcmp(HInfo[i][Owner],pName) != 0)//Checking if the house is owned but the house owner and the players name don't match.
{
SendClientMessage(playerid,-1,"You don't own this house");
}
if(HInfo[i][Owned] == 0)//Simply checking if the house isn't owned.
{
SendClientMessage(playerid,-1,"/buy to buy this lovely house");
}
}
if(pickupid == HouseExit[i])//Checking if the checkpointid is an House exit
{
SetPlayerPos(playerid,HInfo[i][XPos]+3,HInfo[i][YPos],HInfo[i][ZPos]);//Setting the players position to checkpoint position +3
SetPlayerInterior(playerid,GetPVarInt(playerid,"PlayersInteriorHouse"));//Setting the players interior to the one we stored
SetPlayerVirtualWorld(playerid,GetPVarInt(playerid,"PlayerVirtualWorldHouse"));//Setting the players virtual world to the one we stored.
}
}
}
return 1;
}
Thank You
Please Help Me Please
Re: Why does this fall through the sky -
ReneG - 09.05.2012
Quit trying to use these complex scripts for your level. Even if someone fixes it for you, you still come out without learning a thing.
Ontopic, you could freeze the player and set a timer delaying the unfreeze giving enough time for the objects to stream in.
Re: Why does this fall through the sky -
(SF)Noobanatior - 09.05.2012
try doing it in this order
pawn Код:
SetPlayerInterior(playerid,12);//Setting the players interior.
SetPlayerVirtualWorld(playerid,HInfo[i][VirtualWorld]);//Preventing players from different houses,
SetPlayerPos(playerid,446.7281,507.0475,1001.9195);//Setting the players position.
and make the players z coord a little bit higher