SA-MP Forums Archive
format = weird letters - 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: format = weird letters (/showthread.php?tid=441785)



format = weird letters - NvidiaForTheWin - 04.06.2013

hi all.

this is the first time i face this problem.
i have a lot of string format in my GM and they all work fine.

this problem is that in-game i get " le policier 4$dijsjsh3dglkso " and so on.
i hope you understand

this is the related code
Код:
    new name[MAX_PLAYER_NAME];
    new string[20];
    targetID = clickedplayerid;
    GetPlayerName(clickedplayerid,name,sizeof(name));
	format(string, sizeof(string), "Joueur - %s", name);
	ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, name, " Message privй\n Donner\n Vendre", "Suivant", "Annuler");

	if(GetVehicleModel(newvehicleid) == 427 || GetVehicleModel(newvehicleid) == 497 || GetVehicleModel(newvehicleid) == 523 || GetVehicleModel(newvehicleid) == 596 || GetVehicleModel(newvehicleid) == 597 || GetVehicleModel(newvehicleid) == 598 || GetVehicleModel(newvehicleid) == 599)
    {
        ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Controle de police", " Arreter\n Suspecter\n Verifier le permis\n Verifier les passeport\n Regarder la fiche\n Dйsuspecter\n Liberer", "Ok", "Cancel");
		criminelID = clickedplayerid;
	}
Код:
				new messagestring[80];
				new name[MAX_PLAYER_NAME];
				criminelNAME = GetPlayerName(criminelID, name, sizeof(name));
				policierNAME = GetPlayerName(policierID, name, sizeof(name));
				TogglePlayerControllable(criminelID, 0);
				format(messagestring,sizeof(messagestring),"Le policier %s а arreter le criminel %s", policierNAME, criminelNAME);
				SendClientMessage(criminelID, police_color, messagestring);
do you see any probleme somewhere ?
thanks


Re: format = weird letters - NvidiaForTheWin - 04.06.2013

i dont understand what you mean...

the first one is on OnPlayerClickPlayer and the second in dialog response ( fDialog include )

and they both take the name the same way , don't they ?


Re: format = weird letters - NvidiaForTheWin - 04.06.2013

do you mean this ?
Код:
criminelNAME = GetPlayerName(criminelID, name, sizeof(name));
policierNAME = GetPlayerName(policierID, name, sizeof(name));



Re: format = weird letters - NvidiaForTheWin - 04.06.2013

lol i really don't see the problem.
i need to store the the id and name of the cop and the criminal under onplayerclickplayer and need to use them in a dialog.
so i declared these variable globally.

are you able to give me a better hint please


Re: format = weird letters - NvidiaForTheWin - 04.06.2013

thanks.

i finally fixed the problem.

Код:
if(GetVehicleModel(newvehicleid) == 427 || GetVehicleModel(newvehicleid) == 497 || GetVehicleModel(newvehicleid) == 523 || GetVehicleModel(newvehicleid) == 596 || GetVehicleModel(newvehicleid) == 597 || GetVehicleModel(newvehicleid) == 598 || GetVehicleModel(newvehicleid) == 599)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Controle de police", " Arreter\n Suspecter\n Verifier le permis\n Verifier les passeport\n Regarder la fiche\n Dйsuspecter\n Liberer", "Ok", "Cancel");
criminelID = clickedplayerid;
policierID = playerid;
	}
Код:
new crname[MAX_PLAYER_NAME], poname[MAX_PLAYER_NAME], string[42 + MAX_PLAYER_NAME];
GetPlayerName(criminelID, crname, sizeof(crname));
GetPlayerName(policierID, poname, sizeof(poname));
format(string, sizeof(string), "Le criminel %s a йtй arreter par le policier %s", crname, poname);
SendClientMessageToAll(police_color, string);
TogglePlayerControllable(playerid,0);
but i still don't understand what was wrong with the old code... can you explaine please ?