format = weird letters
#1

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
Reply
#2

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 ?
Reply
#3

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

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
Reply
#5

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 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)