How does it actually works?
#1

Can anyone explain me how to create houses? I don't understand how to associate player's account with house (I writing from scratch and using ini reg system writen by myself)
Reply
#2

You need to make your own house system, possibly by creating pickups, and putting it into variables, [HiC]TheKiller has made a tutorial on how to make houses, you can also look at gl_property filterscript, provided by SA-MP with GrandLarc.
Reply
#3

I know how to create pickups.
I can't get other things.
For example, how to prevent player from buying house if he's already had one. And what if player's account has been removed, what about his house?
Reply
#4

Use vars, like..

pawn Код:
new HasHouse[MAX_PLAYERS];
new IsInHouse[MAX_PLAYERS];
etc..
Reply
#5

Quote:
Originally Posted by NiXeL
Посмотреть сообщение
I know how to create pickups.
I can't get other things.
For example, how to prevent player from buying house if he's already had one. And what if player's account has been removed, what about his house?
Lets say there is a house line in the player file (house = -1)
and if he bought a house, lets say houseid 5 (house = 5)
if we read it than and it isnt -1, he got a house

For easier usage just load the saved data into variables

Quote:
Originally Posted by Marricio
Посмотреть сообщение
Use vars, like..

pawn Код:
new HasHouse[MAX_PLAYERS];
new IsInHouse[MAX_PLAYERS];
etc..
If his account is removed the house is ownerless and can be bought again...

After all an house system isnt that complicated,
its more or less two pickups with one id (enter pickup / exit pickup / houseid)
Reply
#6

Using arrays is to recomend..

pawn Код:
enum playerinfo {
    pHouseKey
};

new PlayerInfo[MAX_PLAYERS][pHouseKey];
Reply
#7

Quote:
Originally Posted by Lorrden
Посмотреть сообщение
Using arrays is to recomend..

pawn Код:
enum playerinfo {
    pHouseKey
};

new PlayerInfo[MAX_PLAYERS][pHouseKey];
Sorry for the off-topicness, but did i hear ARRAY? woop woop !

Though, it should be :

pawn Код:
enum playerinfo {
    pHouseKey
};

new PlayerInfo[MAX_PLAYERS][playerinfo];
Reply
#8

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
If his account is removed the house is ownerless and can be bought again...
I know that, i just dont know what is his type of saving system..
But also, its possible to inserting the var value into the .ini file..
Reply
#9

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Lets say there is a house line in the player file (house = -1)
and if he bought a house, lets say houseid 5 (house = 5)
if we read it than and it isnt -1, he got a house

For easier usage just load the saved data into variables



If his account is removed the house is ownerless and can be bought again...

After all an house system isnt that complicated,
its more or less two pickups with one id (enter pickup / exit pickup / houseid)
Man, I was thinking about absolutly the same way, but there was somthing to stop me. If you give me the answer, I think I'll do it that way!

Quote:

If his account is removed the house is ownerless and can be bought again...

HOW? Thank you very much in advance!
Reply
#10

Quote:
Originally Posted by NiXeL
Посмотреть сообщение
HOW? Thank you very much in advance!
The players are associated with the house's, and the house's need to be associated with the players

For that we only need one file ("houses.txt")
There we could add the owernames like ("house_x = name")
Or we just add the names and the line count is the houseid

And if the guy removes now his account we read his houseid and he got one we set the ownername to empty
(You could use 0's (not owned) and 1's (owned) instead of the ownername but maybe you need it for some kind of message)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)