/mdc help!
#1

I have one problem I made /mdc command it works but when I use this command it non-stop say that I or somebody else have 22 years what I have done wrong?
Example somebody have 18 years it say that he have 22 years like me here is my command:

Код:
CMD:mdc(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		if(!IsACop(playerid))
		{
			SCM(playerid, COLOR_GREY, "   You are not a Cop !");
			return 1;
		}
		if(PlayerInfo[playerid][pDBanned] == 1)
		{
			SCM(playerid, COLOR_GREY, "* BANOVANI STE Sa Policijste Duznosti!");
			return 1;
		}
		new string[128],sendername[MAX_PLAYER_NAME],giveplayerid,giveplayer[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername,sizeof(sendername));
		if(sscanf(params,"u",giveplayerid)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /mdc [playerID/DeoImena]");
		new tmpcar = GetPlayerVehicleID(playerid)
		if(IsACopCar(tmpcar)||IsASwatCar(tmpcar)||IsASpecialFCar(tmpcar)||IsATacticalCar(tmpcar)||IsAnFbiCar(tmpcar)||IsNgCar(tmpcar)||IsPlayerInRangeOfPoint(playerid, 5, 253.9280,69.6094,1003.6406))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				SCM(playerid, TEAM_BLUE_COLOR,"______-=MOBILE DATA COMPUTER=-_______");
				format(string, sizeof(string), "Name: %s", giveplayer);
				SCM(playerid, COLOR_WHITE,string);
				format(string, sizeof(string), "Year: %d", PlayerInfo[playerid][pAge]);
				SCM(playerid, COLOR_WHITE,string);
				format(string, sizeof(string), "Crime: %s", PlayerCrime[giveplayerid][pAccusedof]);
				SCM(playerid, COLOR_GRAD2,string);
				format(string, sizeof(string), "Claimant : %s", PlayerCrime[giveplayerid][pVictim]);
				SCM(playerid, COLOR_GRAD3,string);
				format(string, sizeof(string), "Reported : %s", PlayerCrime[giveplayerid][pAccusing]);
				SCM(playerid, COLOR_GRAD4,string);
				format(string, sizeof(string), "Accused : %s", PlayerCrime[giveplayerid][pBplayer]);
				SCM(playerid, COLOR_GRAD5,string);
				SCM(playerid, TEAM_BLUE_COLOR,"_______________________________________");
				new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /mdc %s",d,m,y,h,mi,s,sendername, giveplayer);
				CommandLog(string);
			}
		}
		else
		{
			SCM(playerid, COLOR_GRAD2, "   You are not in a Police Vehicle or in the Police Department.");
			return 1;
		}
	}
	return 1;
}
Reply
#2

Replace:
Код:
format(string, sizeof(string), "Year: %d", PlayerInfo[playerid][pAge]);
With:
Код:
format(string, sizeof(string), "Year: %d", PlayerInfo[giveplayerid][pAge]);
Reply
#3

Oh thank you I'm blind
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)