SA-MP Forums Archive
[Help] With teleporting & dini - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] With teleporting & dini (/showthread.php?tid=175367)



[Help] With teleporting & dini - Prisonbreak.uk.tt - 09.09.2010

Hello,

I'm trying to make buyable houses for my server. But when i make the enter command i only can telepot to the first house. Even when my house == 3 in my dinifile.

Do someone know what i'm doing wrong?

Here is my command:

COMMAND:enter(playerid, params[])
{
new playerfile[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(playerfile, sizeof(playerfile), "Premium/Users/%s.ini",pname);
if(house[playerid] == 1)
{
SetPlayerPos(playerid,2216.1282, -1076.3052, 1050.4844);
SetPlayerFacingAngle(playerid, 90);
SetPlayerInterior(playerid,1);
SetCameraBehindPlayer(playerid);
}
if(house[playerid] == 2)
{
SetPlayerPos(playerid,2365.1089, -1133.0795, 1050.875);
SetPlayerFacingAngle(playerid, 180);
SetPlayerInterior(playerid,;
SetCameraBehindPlayer(playerid);
}
if(house[playerid] == 3)
{
SetPlayerPos(playerid,2323.7063, -1147.6509, 1050.7101);
SetPlayerFacingAngle(playerid, 180);
SetPlayerInterior(playerid,12);
SetCameraBehindPlayer(playerid);
}
return 1;
}


Thanks,

Lil G


Re: [Help] With teleporting & dini - Prisonbreak.uk.tt - 09.09.2010

Someone?


Re: [Help] With teleporting & dini - i514x - 09.09.2010

well, how do you know that house[playerid] equls 3? is this variable set??

//edit: you're setting playerfile variable with string: Premium/Users/%s.ini but you're not using this variable. Why?


Re: [Help] With teleporting & dini - Prisonbreak.uk.tt - 09.09.2010

I'm not exactly sure what you mean, the variable 1, 2 or 3 are the kind of houses the player has bought. in the string 'Premium/Users/%s.ini' it first searches the name of the player, and then what kind of house that player has bought, and then enters the house of that person.

the problem is, that when a player has bought house 2 or 3, it still only enters house 1. do you have any idea what I'm doing wrong and how can this be fixed?

thanks