13.01.2016, 12:29
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.
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(playerid, 1479.8406,-1351.1758,121.4929);//
ApplyAnimation(playerid, "PED", "SEAT_idle", 4.0999, 1, 0, 0, 0, 0);
TogglePlayerControllable(playerid, 0);
AnimPlay[playerid] = 1;
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GetPlayerIp(playerid, ipjucator, sizeof(ipjucator));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(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:", sendername, ipjucator);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"{FFFFFF}Conectare", string,"{FFFFFF}Conectare", "{FFFFFF}Quit"); //login
}
else
{
SetPlayerPos(playerid, 1479.8406,-1351.1758,121.4929);//
ApplyAnimation(playerid, "PED", "SEAT_idle", 4.0999, 1, 0, 0, 0, 0);
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "PED", "SEAT_idle", 4.0999, 1, 0, 0, 0, 0);
AnimPlay[playerid] = 1;
GetPlayerIp(playerid, ipjucator, sizeof(ipjucator));
GetPlayerName(playerid, sendername, sizeof(sendername));
SetPlayerHealth(playerid, 100);
format(string, sizeof(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:", sendername, ipjucator);
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{FFFFFF}Оnregistrare", string, "{FFFFFF}Inregistrare","{FFFFFF}Quit");
}
return 1;
}