Jump to content
  • 0

Problem SQL


BuNiCu-RP

Question

stock LoadEnterFactions(playerid)
{
	new rows;
	new Cache:result = mysql_query(g_SQL, "SELECT * FROM `factions`");	
	if(cache_get_row_count(rows) > 0)
	{
		for(new z = 0; z < cache_get_row_count(rows); z++)
		{
			for(new f = 0; f < rows; f++)
			{
				cache_get_value_float(f, "F_PosX", FVar:z[PosX]);
				cache_get_value_float(f, "F_PosY", FVar:z[PosY]);
				cache_get_value_float(f, "F_PosZ", FVar:z[PosZ]);

				cache_get_value_float(f, "F_EnterY", FVar:z[EntX]);
				cache_get_value_float(f, "F_EnterY", FVar:z[EntY]);
				cache_get_value_float(f, "F_EnterZ", FVar:z[EntZ]);
				cache_get_value_float(f, "F_EnterA", FVar:z[EntA]);
				cache_get_value_int(f, "VW", FVar:z[VW]);
				cache_get_value(f, "F_Name", FVar:z[Name], 64);

				new string[132];
				format(string, sizeof(string), "~h~Bine ati venit la ~n~~y~%s", FVar:z[Name]);

				if(IsPlayerInRangeOfPoint(playerid, 7.0, FVar:z[PosX], FVar:z[PosY], FVar:z[PosZ]))
				{
					printf("Faction %s (Exit Pos: %.f, %.f, %.f)", FVar:z[Name], FVar:z[PosX], FVar:z[PosY], FVar:z[PosZ]);
					printf("Faction %s (Enter Pos: %.f, %.f, %.f)", FVar:z[Name], FVar:z[EntX], FVar:z[EntY], FVar:z[EntZ]);
					SetPlayerInterior(playerid, FVar:z[Interior]);
					SetPlayerPos(playerid, FVar:z[EntX], FVar:z[EntY], FVar:z[EntZ]);
					GameTextForPlayer(playerid, string, 1000, 4);
					// SetPlayerFacingAngle(playerid, FVar:z[EntA]);
					// SetPlayerVirtualWorld(playerid, FVar:z[VW]);
				}
			}
		}
	}
	cache_delete(result);
	return 1;
}

Ce ii pot afec acestui cod sa functioneze in parametri optimi?

Adica el functioneaza, insa cand folosesc /enter pur si simplu ma spawneaza in aer...

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Cred ca e cea mai proasta metoda pe care am vazut-o, deci tu executi acest public la [/enter] ? :))

Nu e bine asa, se creeaza lag + ca este inutila metoda.

Fa un public care sa incarce pozitile exterior/interior/vw/int la OnGameModeInit si sa le salveaze in variabile.

Link to comment
Share on other sites

  • 0
20 hours ago, BuNiCu-RP said:

@Krusher este un stock se apeleaza doar când este apelată comanda, nu creaza lag.

 

se poate da t/c

Si eu daca spamez /enter ? O sa se apeleze acest public aka stock care o sa-mi faca for ca sa-mi extraga datele sa verifice daca sunt sau nu langa o factiune? :)) dfq

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.