SA-MP Forums Archive
House Exit Help +Reps - 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: House Exit Help +Reps (/showthread.php?tid=601488)



House Exit Help +Reps - astanalol - 21.02.2016

Hi
i dont have any idea to make House Exit Like That
PHP код:
PlayerExitHouse(playerid, houseid)
{
    
SetPlayerVirtualWorld(playerid, FREEROAM_WORLD);
    
SetPlayerInterior(playerid, 0);
    
SetPlayerPos(playerid, HouseData[houseid][h_DoorX], HouseData[houseid][h_DoorY], HouseData[houseid][h_DoorZ]);
    
CurrentHouse[playerid]=-1;
    
InsideHouse[playerid]=-1;
} 
SetPlayerPos(playerid, HouseData[houseid][h_DoorX], HouseData[houseid][h_DoorY], HouseData[houseid] i mean this Cuz i made everythings but exit i dont have any idea how to make it please help me Example it please
im use ZCMD / y_ini To Save
thanks guys +reps for help me


Re: House Exit Help +Reps - astanalol - 22.02.2016

Any One Help Please ?


Re: House Exit Help +Reps - MikE1990 - 22.02.2016

Save cordinates outside of house in house file and when player want to exit from house teleport him to cordinates that u saved


Re: House Exit Help +Reps - astanalol - 22.02.2016

Quote:
Originally Posted by MikE1990
Посмотреть сообщение
Save cordinates outside of house in house file and when player want to exit from house teleport him to cordinates that u saved
but i made it dynamic system /createhouse
i want only made somthings like that for exit
PHP код:
new house1Ent, house1Exit; 
new 
house2Ent, house2Exit; 
CMD:createhouse(playerid, params[]) 
{ 
    new 
interior, type[16]; 
    new 
Float:x, Float:y, Float:z; 
    if(
sscanf(params, "is[16]", interior, type)) 
    if(
interior > 7) SendClientMessage(playerid, -1, "Invaild Interior ID"); 
    
GetPlayerPos(playerid, x, y, z); 
    if(!
strcmp(type, "enter", true)) 
    { 
        if(
interior == 1) 
        { 
            
house1Ent = CreateDynamicCP(x, y, z, 2.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 
        } 
        else if(
interior == 2) 
        { 
            
house2Ent = CreateDynamicCP(x, y, z, 2.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 
        } 
    } 
    if(!
strcmp(type, "exit", true)) 
    { 
        if(
interior == 1) 
        { 
            
house1Exit = CreateDynamicCP(234.1368,1063.7231,1084.2123,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0); 
        } 
        else if(
interior == 2) 
        { 
            
house2Exit = CreateDynamicCP(225.7605,1021.4443,1084.0177,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0); 
        } 
    } 
    return 
1; 
} 
public 
OnPlayerEnterDynamicCP(playerid, checkpointid) 
{ 
    if(
checkpointid == house1Ent) 
    { 
        
SetPlayerInterior(playerid,6); 
        
SetPlayerPos(playerid,234.1586,1066.9490,1084.2075); 
    } 
    else if(
checkpointid == house2Ent) 
    { 
        
SetPlayerInterior(playerid,7); 
        
SetPlayerPos(playerid,225.8389,1025.0447,1084.0078); 
    } 
    else if(
checkpointid == house1Exit) 
    { 
        
SetPlayerPos(playerid,272.884979,306.631988,999.148437); 
    } 
    else if(
checkpointid == house2Exit) 
    { 
        
SetPlayerPos(playerid,1526.229980,-11.574499,1002.097106); 
    } 
    return 
1; 
} 
help +reps


Re: House Exit Help +Reps - MikE1990 - 23.02.2016

Yes ok but imagine if you have 500 houses? You will write if for enter and if for exit ? This are 1000 if


Re: House Exit Help +Reps - SyS - 23.02.2016

hmm tp the player to the dynamic pick up's coordinates when he leave this will reduce work


Re: House Exit Help +Reps - MikE1990 - 23.02.2016

Quote:

hmm tp the player to the dynamic pick up's coordinates when he leave this will reduce work

Yeap that im saying too


Re: House Exit Help +Reps - astanalol - 23.02.2016

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
hmm tp the player to the dynamic pick up's coordinates when he leave this will reduce work
what you mean :O i dont know
i want change this
PHP код:
    else if(checkpointid == house1Exit) 
    { 
        
SetPlayerPos(playerid,272.884979,306.631988,999.148437); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    } 
Cuz when im /createhouse its will made every time this Pos
i want idea i dont care its will be pickups or checkpoints for exit but need it dont mix i will made much house with this interior


Re: House Exit Help +Reps - astanalol - 24.02.2016

Bump Please !!!


Re: House Exit Help +Reps - MikE1990 - 25.02.2016

Dude we already told you save cordinates outside house and teleport him when he want to exit if you dont know how to code it
https://sampforum.blast.hk/showthread.php?tid=179206
Tutorial explain everything