How to make player spawn at house? -
Strummer - 17.07.2014
I used the Gagi house system at it works out great, but I just need a function to make player spawn at his house after login, instead of the usual spawn place. If someone could show me how to do this, I'd be real grateful
Re: How to make player spawn at house? -
biker122 - 17.07.2014
You can use SetPVar's and could you tell me which saving system you use for user files saving?
* Could you also tell me what saving system does GagiHouse system use
Also, how much houses can a player own in your server?
Re: How to make player spawn at house? -
Strummer - 17.07.2014
Well, the enums and LoadUser_data for Users and Houses are separated. So in scriptfiles, its 2 different folders

And a player can own 1 house.
Re: How to make player spawn at house? -
Strummer - 20.07.2014
Anyone?
Re: How to make player spawn at house? -
Ahmad45123 - 20.07.2014
Quote:
Originally Posted by Strummer
Anyone?
|
We need the code where you load the players stuff.
Re: How to make player spawn at house? -
Strummer - 20.07.2014
Oh, right.
Код:
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("Sex",PlayerInfo[playerid][pSex]);
INI_Int("Age",PlayerInfo[playerid][pAge]);
INI_Int("Paytime",PlayerInfo[playerid][pPaytime]);
INI_Int("Respekti",PlayerInfo[playerid][pRespekti]);
INI_Int("Level",PlayerInfo[playerid][pLevel]);
INI_Int("Bank_Wealth", PlayerInfo[playerid][BankWealth]);
INI_String("Bank_Password", PlayerInfo[playerid][BankPassword], 129);
INI_Int("Skin", PlayerInfo[playerid][pSkin]);
return 1;
}
The filterscript uses Dini:
Код:
format(file,sizeof(file),"Houses/%i.ini",i);
if(!dini_Exists(file)) continue;
if(dini_Exists(file))
{
HouseInfo[i][Name] = strval(dini_Get(file,"Name"));
HouseInfo[i][Level] = dini_Int(file,"Level");
HouseInfo[i][Price] = dini_Int(file,"Price");
HouseInfo[i][Owned] = dini_Int(file,"Owned");
HouseInfo[i][hX] = dini_Float(file,"X");
HouseInfo[i][hY] = dini_Float(file,"Y");
HouseInfo[i][hZ] = dini_Float(file,"Z");
HouseInfo[i][hVirtual] = dini_Int(file,"VirtualWorld");
hOwner = dini_Get(file,"Owner");
format(HouseInfo[i][Owner],24,"%s",hOwner);
As you can see, it uses a separate folder named Houses.
Re: How to make player spawn at house? -
Ahmad45123 - 20.07.2014
Sorry, We cant do it, Unless if they were 1 script.
Re: How to make player spawn at house? -
sammp - 20.07.2014
Quote:
Originally Posted by Ahmad45123
Sorry, We cant do it, Unless if they were 1 script.
|
Wrong. You could easily do that in the FS.
Re: How to make player spawn at house? -
Strummer - 20.07.2014
Umm, how?
Re: How to make player spawn at house? -
Ahmad45123 - 20.07.2014
Quote:
Originally Posted by sammp
Wrong. You could easily do that in the FS.
|
You are wrong, If he did it in the filterscript, The main Gamemode will set his poistion again to the last saved one.