Jump to content

Question

Posted

Am si eu o problema cu comanda stats cand o compilez gm nu se intmpla nimic doar se blocheaza cand scot comanda merge ce  sa aiba ?

CMD:stats(playerid,params[])
{
	new string[1000], nstats[128] , pDeaths2, player1, player, h, m, s;

	if(sscanf(params, "r", player))
	{
		player1 = playerid;
	}
	else
	{
		player1 = player;
	}
	new Cmdr = P_DATA[player1][CmdR],
		Cmdnr = P_DATA[player1][CmdNr];
	if(IsPlayerConnected(player1))
	{
		TotalGameTime(player1, h, m, s);
 		if(P_DATA[player1][pDeaths] == 0) { pDeaths2 = 1; }
	 	else { pDeaths2 = P_DATA[player1][pDeaths]; }
	 	format(string, sizeof(string), "%s  "W"*"O"M"W"inutes"R":\t"W"["G"%d"W"]\n  "W"*"O"S"W"econds"R":\t"W"[ "G"%d "W"]\n\t"O"R"W"egister date"G":\t"W"[ "G"%s "W"]\n\t"O"C"W"omenzi-Reusite"R": "W"[ "G"%d "W"]\n\t"O"C"W"omenzi-Nereusite"R": "W"[ "G"%d "W"]",h,m,s,P_DATA[player1][RegDate],Cmdr,Cmdnr);
		format(string, sizeof(string), "%s\t"O"M"W"oney"R":\t"W"[ "G"$%d "W"]\n\t"O"V"W"IP Level"R":\t"W"[ "G"%d "W"]\n "W"*"O"H"W"ours"R":\t\t"W"["G"%d"W"]\n",GetPlayerMoney(player1),P_DATA[player1][pVip]);
 		format(string, sizeof(string), "\n\t"O"K"W"ills"R":\t\t"W"[ "G"%d "W"]\n\t"O"D"W"eaths"R":\t"W"[ "G"%d "W"]\n\t"O"K"W"/"O"D"R":\t\t"W"[ "G"%0.2f "W"]\n\t"O"S"W"core"R":\t\t"W"[ "G"%d "W"]\n",P_DATA[player1][pKills], P_DATA[player1][pDeaths],Float:P_DATA[player1][pKills]/Float:pDeaths2,GetPlayerScore(player1));
 		format(nstats, sizeof(nstats),"Status: %s",GetName(player1));
		ShowPlayerDialog(playerid, STATS_DIALOG, DIALOG_STYLE_MSGBOX, nstats, string, "OK", "");
	}
	else
	{
		SendClientMessage(playerid, -1, "Player is not connected!");
	}
	return 1;
}

I'm back bitches.

2 answers to this question

Recommended Posts

Posted

Pune

[pawn] if(!strlen(params)) player1 = playerid;

    else player1 = strval(params);[/pawn]

In Loc de :

[pawn] if(sscanf(params, "r", player))

{

player1 = playerid;

}

else

{

player1 = player;

}[/pawn]

idiots.png
Posted

Boss eu folosesc sscanf nu strtok :)) si cum ai zis tu nu merge  :tongue:

Edit: dati T/C.

Rezolvare : Prea multe Culori acele "O" sunt definite Stergeti si puneti codul de culoare asa {FF8000}//in cazul meu xD

I'm back bitches.

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.