Jump to content
  • 0

Problema muzicuta.


Jomes.

Question

Nume:Vanilla
Problemă întâlnită: Cand introduc functia TogglePlayerSpectating(playerid, 1) la OnPlayerRequestClass nu-mi mai porneste melodia de la logare/inregistrare 
Ce am încercat până acum: Sa schimb pozitile funtiilor.
Codul sursa/Log/Altele:
[pawn]
public OnPlayerRequestClass(playerid, classid)
{
if(gPlayerLogged[playerid] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, -1976.5912,166.1818,36.9623);
SetPlayerFacingAngle(playerid, 272.6393);
SetPlayerCameraPos(playerid,-1976.5912 + 3, 166.1818,36.9623);
SetPlayerCameraLookAt(playerid,-1976.5912,166.1818,36.9623);
TogglePlayerControllable(playerid, 0);
if(PlayerInfo[playerid][pMember] == 0 && PlayerInfo[playerid][pLeader] == 0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, -1976.5912,166.1818,36.9623);
SetPlayerFacingAngle(playerid, 272.6393);
SetPlayerCameraPos(playerid,-1976.5912 + 3, 166.1818,36.9623);
SetPlayerCameraLookAt(playerid,-1976.5912,166.1818,36.9623);
TogglePlayerControllable(playerid, 0);
   PlayerInfo[playerid][pModel] = Peds[classid][0];
new rand = random(10);
   SetPlayerVirtualWorld(playerid, rand);
}
}
if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
{
   TogglePlayerSpectating(playerid, 1);
SetPlayerFacingAngle(playerid, 3.41);
  SetPlayerCameraPos(playerid, 1230.90, -1287.72, 254.17);
  SetPlayerCameraLookAt(playerid, 1227.04, -1289.05, 251.27);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, 0);
if (gPlayerAccount[playerid] != 0)
{
new loginstring[320];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
new laston[64];
new field[128];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(field,128,"SELECT `lastOn`  FROM users WHERE `name`='%s'",loginname);
mysql_query(SQL,field);
mysql_store_result();
if(mysql_retrieve_row())
{
mysql_fetch_field_row(laston, "lastOn");
}
mysql_free_result();
PlayAudioStreamForPlayer(playerid, "server/tgf.mp3");
format(loginstring,sizeof(loginstring),"Welcome back, {5D8CD7}%s{A9C4E4}!nn{A9C4E4}Please enter your password below to login your accountnn{FFFFFF}* Last login: %s *",loginname,laston);
ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Quit");
}
else
{
gPlayerAccount[playerid] = 0;
  new regstring[200];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
PlayAudioStreamForPlayer(playerid, "server/tgf.mp3");
format(regstring,sizeof(regstring),"Welcome to the server, {5D8CD7}%s{A9C4E4}!nnYou don't have an account.nPlease register your account to proceed by typing a password below.",regname);
ShowPlayerDialog(playerid,DIALOG_LOGIN1,DIALOG_STYLE_PASSWORD,"Register",regstring,"Register","Quit");
SCM(playerid,COLOR_LIGHTRED,"* Please register your account in 30 seconds or you will be kicked.");
}
login[playerid] = SetTimerEx("Logink",30000,false,"d",playerid);
}
else if(IsPlayerNPC(playerid)) return 1;
return 1;
}[/pawn]

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

Buna ziua stimate.

 

Personal cred caci complicati prea mult situatia si as dori sa va sugerez sa mutati lansarea audio la conectarea playerilor pe server,mai precis spus la public OnPlayerConnect(playerid).

 

*  La public OnPlayerSpawn(playerid) sa nu uitati sa deconectati fluxul audio. ( StopAudioStreamForPlayer(playerid); )

 

Ar fi cea mai logica miscare pentru a optimiza putin Gamemode-ul dumneavoastra, parerea mea.

 

 

ep41yhufqpagka5wfoornw1wjfjie.png

Edited by ARTIST

ep41yhufqpagka5wfoornw1wjfjie.png

HTjr_G.png
12975.png
 
Link to comment
Share on other sites

Pune un link de la radio sa vezi daca se mai opreste. Ea nu trebuie sa se opreasca, e altceva din script-ul tau. Pentru a fii sigur fai si un update la include si recompileaza gamemode-ul.

 

Apropo, este filterscript sau gamemode?

Link to comment
Share on other sites

Incearca mai intai sa pui sa cante melodia , iar dupa aceea sa ii dea TogglePlayerSpectating(...);

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.