#1

Hi,
I have edited a House System but I do not want to build a house as it is possible and could you help me?
I know to provide the entire House System....
Thanks
Reply
#2

I have only edited the stock, but I can not build the houses and I do not build the cars
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
provide the entire House System….
I've already erased it house system...

But I have one problem here. I have a house number 200 to build a car Buffalo, that car belongs to the house 200..
But when I get in the car, it will show me that this car has its own EmpireSk... I can not get in the car even when I have a username EmpireSk...

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if(!
IsPlayerNPC(playerid))
    {
        if(
IsPlayerConnected(playerid))
        {
                        if(!
ispassenger)
            {
                if(
IsPlayerConnected(playerid))
                {
                    for(new 
houseid;houseid<MAX_HOUSES;houseid++)
                    {
                        for(new 
x;x<HouseInfo[houseid][CarSlots];x++)
                        {
                            if(
vehicleid == Vehicle[houseid][x])
                            {
                                new 
HC GetPVarInt(playerid,"CarID");
                                new 
sa[128];
                                
format(sa,100,"VRLS/Houses/House%d.Car%d.txt",houseid,HC);
                                new 
blockmsg[128];
                                
format(blockmsg,128,"~r~WARNING~n~~n~~w~This vehicle belongs to the player:~n~~g~%s",DOF2_GetString(sa,"Owner"));
                                
FormatPlayerInfoBox(playerid,"~g~Virtual Reality",blockmsg,3000);
                                
StopPlayer(playerid);
                                return 
0;
                            }
                        }
                    }
                }
            }
        }
    }
    return 
1;

Reply
#4

This killed me inside.

Код:
if(IsPlayerConnected(playerid)) 
        { 
                        if(!ispassenger) 
            { 
                if(IsPlayerConnected(playerid))
You don't any IsPlayerConnected() checks not one!

Also why would you return 0 in this callback? What if there is other systems that need to do work regardless if the player can enter a vehicle or not ?
Reply
#5

One if(IsPlayerConnected(playerid)) is delete and return and I get back return 1... and did not do anything
Reply
#6

Quote:
Originally Posted by EmpireSk
Посмотреть сообщение
One if(IsPlayerConnected(playerid)) is delete and return and I get back return 1... and did not do anything
BOTH! The player IS CONNECTED obviously! Why would you think of checking?
Reply
#7

2x if(IsPlayerConnected(playerid)) is delete... But it still does not work
Reply
#8

So start putting in lots of printf() functions and follow what is happening. Print all your variables etc. At the different times they change. It's really so easy shouldn't take more than 30 seconds to "rig" that code up.

I will tell you right now it is possible to eliminate both of those for loops with a couple lines of code.
Reply
#9

I have tried to do it this way do.... But it works completely differently

I'm already desperate

PHP код:

if(!ispassenger)
        {
            for(new 
houseid;houseid<MAX_HOUSES;houseid++)
            {
                for(new 
x;x<HouseInfo[houseid][CarSlots];x++)
                {
                    if(
vehicleid == Vehicle[houseid][x])
                    {
                        new 
HC GetPVarInt(playerid,"CarID");
                        new 
sa[128];
                        
format(sa,100,"VRLS/Houses/House%d.Car%d.txt",houseid,HC);
                        if(!
DOF2_IsSet(sa,"Owner"))
                        {
                            new 
blockmsg[128];
                            
format(blockmsg,128,"~r~WARNING~n~~n~~w~This vehicle belongs to the player:~n~~g~%s",DOF2_GetString(sa,"Owner"));
                            
FormatPlayerInfoBox(playerid,"~g~Virtual Reality",blockmsg,3000);
                            
StopPlayer(playerid);
                            return 
1;
                        }
                    }
                }
            }
        } 
Reply
#10

Excuse me but your code is whole a mess. Hard to understand and painful to read.

What are you trying to do? What's the problem? Can you explain more?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)