SA-MP Forums Archive
[Help] Weird problem with string ID 1 - 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: [Help] Weird problem with string ID 1 (/showthread.php?tid=647778)



[Help] Weird problem with string ID 1 - David (Sabljak) - 10.01.2018

So. Never seen this kinda shit.

ID 1 is never reading good ID from %d.
ID 0 and 2 works fine as shown in pictures.
Код:
format(recon_string, sizeof(recon_string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d~n~~g~%.1f hp",PlayerName(ReconanID[i]), ReconanID[i], zdravlje);
GameTextForPlayer(i, recon_string, 3500, 3);
Pictures - https://imgur.com/a/4Qm8z

Last version of sscanf, and everything is updated, everything works fine for ID 1 only this is bugged. Why the F...


Re: [Help] Weird problem with string ID 1 - Dayrion - 10.01.2018

Without codes, it's very hard to help you.


Re: [Help] Weird problem with string ID 1 - David (Sabljak) - 11.01.2018

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Without codes, it's very hard to help you.
It's on timer and it's refreshing every 3 second.

Код:
new recon_string[128],Float:zdravlje;
				SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(ReconanID[i]));
				SetPlayerInterior(i,GetPlayerInterior(ReconanID[i]));
				GetPlayerHealth(ReconanID[i],zdravlje);
				if(IsPlayerInAnyVehicle(ReconanID[i]))
				{
				    PlayerSpectateVehicle(i, GetPlayerVehicleID(ReconanID[i]));
				    format(recon_string, sizeof(recon_string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d~n~~g~%.1f hp~n~~r~%d km/h",PlayerName(ReconanID[i]), ReconanID[i], zdravlje, IgracevaBrzina(ReconanID[i]));
				    GameTextForPlayer(i, recon_string, 3500, 3);
				}
				else
				{
				    PlayerSpectatePlayer(i, ReconanID[i]);
				    format(recon_string, sizeof(recon_string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d~n~~g~%.1f hp",PlayerName(ReconanID[i]), ReconanID[i], zdravlje);
				    GameTextForPlayer(i, recon_string, 3500, 3);
				}
Im telling you, every other ID work's fine, only ID 1 is causing that strange bug with text and not reading ID... %d


Re: [Help] Weird problem with string ID 1 - Dayrion - 11.01.2018

Quote:
Originally Posted by David (Sabljak)
Посмотреть сообщение
It's on timer and it's refreshing every 3 second.

Код:
new recon_string[128],Float:zdravlje;
				SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(ReconanID[i]));
				SetPlayerInterior(i,GetPlayerInterior(ReconanID[i]));
				GetPlayerHealth(ReconanID[i],zdravlje);
				if(IsPlayerInAnyVehicle(ReconanID[i]))
				{
				    PlayerSpectateVehicle(i, GetPlayerVehicleID(ReconanID[i]));
				    format(recon_string, sizeof(recon_string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d~n~~g~%.1f hp~n~~r~%d km/h",PlayerName(ReconanID[i]), ReconanID[i], zdravlje, IgracevaBrzina(ReconanID[i]));
				    GameTextForPlayer(i, recon_string, 3500, 3);
				}
				else
				{
				    PlayerSpectatePlayer(i, ReconanID[i]);
				    format(recon_string, sizeof(recon_string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d~n~~g~%.1f hp",PlayerName(ReconanID[i]), ReconanID[i], zdravlje);
				    GameTextForPlayer(i, recon_string, 3500, 3);
				}
Im telling you, every other ID work's fine, only ID 1 is causing that strange bug with text and not reading ID... %d
I encountered exactly the same bug and nothing to fix it.
PHP код:
format(string, sizeof(string), "~n~~n~~n~~n~~n~~g~%i~w~-~r~%i", trainingSucces[playerid], trainingMissed[playerid]); 



Re: [Help] Weird problem with string ID 1 - David (Sabljak) - 12.01.2018

Really? Only on ID 1? ..who can help us?


Re: [Help] Weird problem with string ID 1 - David (Sabljak) - 19.02.2018

anyone? bump? ... when i do outside of that timer it works normal...

Код:
CMD:recontest(playerid, params[])
{
	new id,string[128];
    if(sscanf(params, "u", id)) return Use(playerid,"/recontest [ID]");
	if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return WrongID(playerid);
	format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~w~%s ~y~ID: ~w~%d",PlayerName(id), id);
	GameTextForPlayer(playerid, string, 4500, 3);
    return 1;
}



Re: [Help] Weird problem with string ID 1 - Mugala - 19.02.2018

debug ReconanID[i] and try to figure out what params it have.
also does this PlayerSpectateVehicle(i, GetPlayerVehicleID(ReconanID[i])); <-- work for ID 0?


Re: [Help] Weird problem with string ID 1 - David (Sabljak) - 19.02.2018

Using ReconanID[playerid] = id; to define what ID you spectating...

It works for every ID expect ID 1, i mean, only the bug with ID string ...