#1

Hey guys. I have this problem on house system. When i create house it works fine and everything is created as it should. Then i buy house and it sends me to interior and that is fine too. But i can't get out of house. I can't exit it
PHP код:
if(IsPlayerInRangeOfPoint(playerid3.0KucaInfo[i][kIzlazX], KucaInfo[i][kIzlazY], KucaInfo[i][kIzlazZ]) && GetPlayerVirtualWorld(playerid) == KucaInfo[i][kVW])
            {
                
SetPlayerPos(playeridKucaInfo[i][kUlazX], KucaInfo[i][kUlazY], KucaInfo[i][kUlazZ]);
                
SetPlayerInterior(playerid0); 
                
SetPlayerVirtualWorld(playerid0); 
            } 
There it is. When i am on exit coords it should spawn me on enter coords. I have no idea what is wrong
Reply
#2

Where you put this code?
Reply
#3

PHP код:
if(newkeys == KEY_SECONDARY_ATTACK )
    {
        for(new 
iMAX_KUCAi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid3.0KucaInfo[i][kUlazX], KucaInfo[i][kUlazY], KucaInfo[i][kUlazZ]))
            {
                if(
PlayerInfo[playerid][PosedovanjeKuce] == || KucaInfo[i][kZatvoreno] == 0)
                   {
                    
SetPlayerVirtualWorld(playeridKucaInfo[i][kVW]);
                    
SetPlayerInterior(playeridKucaInfo[i][kInt]);
                     
SetPlayerPos(playeridKucaInfo[i][kIzlazX], KucaInfo[i][kIzlazY], KucaInfo[i][kIzlazZ]);
                }
                else return 
ERROR(playerid"Kuca je zakljucana!");
            }
            if(
IsPlayerInRangeOfPoint(playerid3.0KucaInfo[i][kIzlazX], KucaInfo[i][kIzlazY], KucaInfo[i][kIzlazZ]) && GetPlayerVirtualWorld(playerid) == KucaInfo[i][kVW])
            {
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerPos(playeridKucaInfo[i][kUlazX], KucaInfo[i][kUlazY], KucaInfo[i][kUlazZ]);
            }
        }
    } 
There is whole code. It goes under OnPlayerKeyStateChange. But problem is that i can exit house only if it is ID 0. If i create house with ID 1 i can't exit it ID 2 also and so on..
Reply
#4

return in loop breaks it, try this
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK )
    {
        for(new 
iMAX_KUCAi++)
        {
            if(
IsPlayerInRangeOfPoint(playerid3.0KucaInfo[i][kUlazX], KucaInfo[i][kUlazY], KucaInfo[i][kUlazZ]))
            {
                if(
PlayerInfo[playerid][PosedovanjeKuce] == || KucaInfo[i][kZatvoreno] == 0)
                   {
                    
SetPlayerVirtualWorld(playeridKucaInfo[i][kVW]);
                    
SetPlayerInterior(playeridKucaInfo[i][kInt]);
                     
SetPlayerPos(playeridKucaInfo[i][kIzlazX], KucaInfo[i][kIzlazY], KucaInfo[i][kIzlazZ]);
                }
                else 
ERROR(playerid"Kuca je zakljucana!");
            }
            if(
IsPlayerInRangeOfPoint(playerid3.0KucaInfo[i][kIzlazX], KucaInfo[i][kIzlazY], KucaInfo[i][kIzlazZ]) && GetPlayerVirtualWorld(playerid) == KucaInfo[i][kVW])
            {
                
SetPlayerInterior(playerid0);
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerPos(playeridKucaInfo[i][kUlazX], KucaInfo[i][kUlazY], KucaInfo[i][kUlazZ]);
            }
        }
    } 
Reply
#5

its hard for people to help you in an non english script translate it for us.
Reply
#6

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
its hard for people to help you in an non english script translate it for us.
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK )
{
    for(new 
iMAX_HOUSESi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid3.0HouseInfo[i][kEnterX], HouseInfo[i][kEnterY], HouseInfo[i][kEnterZ]))
        {
            if(
PlayerInfo[playerid][PosedovanjeKuce] == || HouseInfo[i][kZatvoreno] == 0)
            {
                
SetPlayerVirtualWorld(playeridHouseInfo[i][kVW]);
                
SetPlayerInterior(playeridHouseInfo[i][kInt]);
                
SetPlayerPos(playeridHouseInfo[i][kExitX], HouseInfo[i][kExitY], HouseInfo[i][kExitZ]);
            }
            else 
ERROR(playerid"House is locked!");
        }
        if(
IsPlayerInRangeOfPoint(playerid3.0HouseInfo[i][kExitX], HouseInfo[i][kExitY], HouseInfo[i][kExitZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][kVW])
        {
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerPos(playeridHouseInfo[i][kEnterX], HouseInfo[i][kEnterY], HouseInfo[i][kEnterZ]);
        }
    }

Here you go
Reply
#7

Try this
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK 

    for(new 
i<= MAX_HOUSESi++) 
    { 
        if(
IsPlayerInRangeOfPoint(playerid3.0HouseInfo[i][kEnterX], HouseInfo[i][kEnterY], HouseInfo[i][kEnterZ])) 
        { 
            if(
PlayerInfo[playerid][PosedovanjeKuce] == || HouseInfo[i][kZatvoreno] == 0
            { 
                
SetPlayerVirtualWorld(playeridHouseInfo[i][kVW]); 
                
SetPlayerInterior(playeridHouseInfo[i][kInt]); 
                
SetPlayerPos(playeridHouseInfo[i][kExitX], HouseInfo[i][kExitY], HouseInfo[i][kExitZ]); 
            } 
            else 
SendClientMessage(playerid0xFF0000"ERROR: House is locked!"); 
        } 
        if(
IsPlayerInRangeOfPoint(playerid3.0HouseInfo[i][kExitX], HouseInfo[i][kExitY], HouseInfo[i][kExitZ]) && GetPlayerVirtualWorld(playerid) == HouseInfo[i][kVW]) 
        { 
            
SetPlayerInterior(playerid0); 
            
SetPlayerVirtualWorld(playerid0); 
            
SetPlayerPos(playeridHouseInfo[i][kEnterX], HouseInfo[i][kEnterY], HouseInfo[i][kEnterZ]); 
        } 
    } 

Reply
#8

Still nope
Reply
#9

Quote:

PosedovanjeKuce HouseInfo[i][kZatvoreno

Translation means translation, what the hell are these variables supposed to do and how should we know it?

And also do not post 9 topics for your crappy system, we are not your code-fixing minions and we are not planning to be, you must have patience if you need help here, or go pay 500$ for classes in institutions to teach you how to use a loop.
Reply
#10

Quote:
Originally Posted by PrO.GameR
Посмотреть сообщение
Translation means translation, what the hell are these variables supposed to do and how should we know it?

And also do not post 9 topics for your crappy system, we are not your code-fixing minions and we are not planning to be, you must have patience if you need help here, or go pay 500$ for classes in institutions to teach you how to use a loop.
First of all that was rude. So rude. Second of all it is not crappy it has one fucking bug. Third of all i spent WHOLE MORNING trying to fix that and then you come here saying something like that? And last thing. It is not about loops VirtualWorld is making problem..

PS:Sorry for bad words guys hope you won't mind it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)