SA-MP Forums Archive
SetPlayerCameraPos help - 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)
+--- Thread: SetPlayerCameraPos help (/showthread.php?tid=598488)



SetPlayerCameraPos help - radiobizza - 13.01.2016

So.
On my server, when a player connects and the script checks him if he have an account, I want to set a position to player in an interior and apply an animation. This is what i've done but when I connect to the game to register on the server, i fall from the sky. I don't know what to do. This is the script when the player connects.
PHP код:
public OnPlayerConnect(playerid)
{
    if(
fexist(UserPath(playerid)))
    {                           
        
SetPlayerPos(playerid1479.8406,-1351.1758,121.4929);//
        
ApplyAnimation(playerid"PED""SEAT_idle"4.099910000);
        
TogglePlayerControllable(playerid0);
        
AnimPlay[playerid] = 1;
        
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
        
GetPlayerIp(playeridipjucatorsizeof(ipjucator));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
format(stringsizeof(string), "{FFFFFF}Bine ai revenit pe Play Arena {7FFFD4}%s {FFFFFF}!\n{FFFFFF}IP: {7FFFD4}%s\n{FFFFFF}Acest nume este deja оnregistrat !\n{FFFFFF}Te rog scrie parola оn căsuta de mai jos pentru a putea intra оn joc:"sendernameipjucator);
        
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{FFFFFF}Conectare"string,"{FFFFFF}Conectare""{FFFFFF}Quit"); //login
    
}
    else
    {
        
SetPlayerPos(playerid1479.8406,-1351.1758,121.4929);//
        
ApplyAnimation(playerid"PED""SEAT_idle"4.099910000);
        
TogglePlayerControllable(playerid0);
        
ApplyAnimation(playerid"PED""SEAT_idle"4.099910000);
        
AnimPlay[playerid] = 1;
        
GetPlayerIp(playeridipjucatorsizeof(ipjucator));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
SetPlayerHealth(playerid100);
        
format(stringsizeof(string), "{FFFFFF}Bine ai venit pe Play Arena {7FFFD4}%s {FFFFFF}!.\n{FFFFFF}IP: {7FFFD4}%s\n{FFFFFF}Pentru a te putea inregistra,scrie o parolă оn căsuta de mai jos pentru a putea continua:"sendernameipjucator);
        
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{FFFFFF}Оnregistrare"string"{FFFFFF}Inregistrare","{FFFFFF}Quit");
    }
    return 
1;




Re: SetPlayerCameraPos help - jlalt - 13.01.2016

possibility you miss SetPlayerInterior(playerid, interiorid); don't you?


Re: SetPlayerCameraPos help - radiobizza - 13.01.2016

No. I added the SetPlayerInterior after i post this and it doesn't work


Re: SetPlayerCameraPos help - jlalt - 13.01.2016

Quote:
Originally Posted by radiobizza
Посмотреть сообщение
No. I added the SetPlayerInterior after i post this and it doesn't work
well, you see interior objects or empty floor and player fall from it?


Re: SetPlayerCameraPos help - radiobizza - 13.01.2016

after i put some dialogs, i type /tp2 and put me right where i want but when I connect to the server,i can't see the objects


Re: SetPlayerCameraPos help - jlalt - 13.01.2016

Quote:
Originally Posted by radiobizza
Посмотреть сообщение
after i put some dialogs, i type /tp2 and put me right where i want but when I connect to the server,i can't see the objects
then use SetPlayerInterior again above SetPlayerPos and it should work


Re: SetPlayerCameraPos help - radiobizza - 13.01.2016

it still doesn't work...


in this pictures you can see what i don't want to appear


Re: SetPlayerCameraPos help - IceBilizard - 13.01.2016

You are using CreateObject or CreateDynamicObject?
CreateObject can be view every time and CreateDynamicObject will show after when you spawn.


Re: SetPlayerCameraPos help - radiobizza - 13.01.2016

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
You are using CreateObject or CreateDynamicObject?
CreateObject can be view every time and CreateDynamicObject will show after when you spawn.
i have just 2 mapps. one for spawn and another one for registration dialog and log-in
On the first map i use CreateDynamicObject and at the spawn for registration I use SetObjectMaterialText like this
PHP код:
    tmpobjid CreateObject(19375,1475.996,-1354.330,120.407,0.000,90.000,0.000,300.000);
    
SetObjectMaterial(tmpobjid014832"lee_stripclub""Strip_wood_floor"0); 



Re: SetPlayerCameraPos help - radiobizza - 13.01.2016

bump