House Exit Help +Reps
#1

Hi
i dont have any idea to make House Exit Like That
PHP код:
PlayerExitHouse(playeridhouseid)
{
    
SetPlayerVirtualWorld(playeridFREEROAM_WORLD);
    
SetPlayerInterior(playerid0);
    
SetPlayerPos(playeridHouseData[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
Reply
#2

Any One Help Please ?
Reply
#3

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

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 house1Enthouse1Exit
new 
house2Enthouse2Exit
CMD:createhouse(playeridparams[]) 

    new 
interiortype[16]; 
    new 
Float:xFloat:yFloat:z
    if(
sscanf(params"is[16]"interiortype)) 
    if(
interior 7SendClientMessage(playerid, -1"Invaild Interior ID"); 
    
GetPlayerPos(playeridxyz); 
    if(!
strcmp(type"enter"true)) 
    { 
        if(
interior == 1
        { 
            
house1Ent CreateDynamicCP(xyz2.0GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); 
        } 
        else if(
interior == 2
        { 
            
house2Ent CreateDynamicCP(xyz2.0GetPlayerVirtualWorld(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(playeridcheckpointid

    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
Reply
#5

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

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

Quote:

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

Yeap that im saying too
Reply
#8

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
Reply
#9

Bump Please !!!
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)