Odg: [Pomoc]level

Započeo Aldin Begovic, Mart 02, 2012, 21:38:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

mod:GF
opis problema:Nece da mi kupi kucu ! Kaze da nemam level a imam level :S !
cod:
COMMAND:kupikucu(playerid, params[])
{
	#pragma unused params
	new string[ 128 ], stringt[64];
	if( PlayerInfo[playerid][pPhousekey] == 255 )
	{
		for(new h = 0; h < sizeof(Houses); h++)
		{
	    	if(IsPlayerInRangeOfPoint( playerid, 5, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]) )
	    	{
	        	if(strcmp(Houses[h][hOwner], "Niko", true) == 0 )
				{
				    if(Houses[h][HousePrice] == -1)
				    {
				        SendClientMessage( playerid, WHITE, "Ova kuca nije na prodaji." );
						return 1;
				    }

					 if(Houses[h][hLevel] > PlayerInfo[playerid][pLevel])
				    {
				        format( string, sizeof(string), "Moras biti lvl %d da bi mogao kupiti ovu kucu." , Houses[h][hLevel]);
						SendClientMessage( playerid, WHITE, string);
						return 1;
				    }
				    else
				    {
				    	if( GetPlayerCash(playerid) > Houses[h][HousePrice])
				    	{
							new sendername[MAX_PLAYER_NAME];
							Houses[h][hVec] = 418;
							Houses[h][hVcol1] = -1;
							Houses[h][hVcol2] = -1;
							Houses[h][hOwned] = 1;
				        	GivePlayerCash(playerid, -Houses[h][HousePrice]);
					        GetPlayerName(playerid, sendername, sizeof(sendername));
							strmid(Houses[h][hOwner], sendername, 0, strlen(sendername), 255);
							format( stringt, sizeof( stringt ), "~y~Kupili ste kucu za: ~g~%d$", Houses[h][HousePrice]);
					        format( string, sizeof( string ), "Cestitamo! Vi sada posjedujete kucu sa adresom: %s ; Opis: %s (ID Kuce: %d)", Houses[h][hAddres],Houses[h][hOpis], h);
					        SendClientMessage( playerid, ANNOUNCEMENT, string);
					        PlayerInfo[playerid][pPhousekey] = h;

							OnPropTextdrawUpdate();
							 if(Houses[h][hType] == 1)
							{
							ShowPlayerDialog(playerid, KUCAMENU1, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Mala Kuca","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3\n{0080C0}Interijer 4", "Odaberi", "Ponisti");
							}
							if(Houses[h][hType] == 2)
							{
							ShowPlayerDialog(playerid, KUCAMENU2, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Srednja Kuca","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3\n{0080C0}Interijer 4", "Odaberi", "Ponisti");
							}
							if(Houses[h][hType] == 3)
							{
							ShowPlayerDialog(playerid, KUCAMENU3, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Velika Kuca","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3\n{0080C0}Interijer 4", "Odaberi", "Ponisti");
							}
							if(Houses[h][hType] == 4)
							{
							ShowPlayerDialog(playerid, KUCAMENU4, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Vila","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3", "Odaberi", "Ponisti");
							}
							 if(Houses[h][hType] == 0)
							{
							ShowPlayerDialog(playerid, KUCAMENU1, DIALOG_STYLE_LIST, "{FF0000}Odaberi Interijer - {FFFF00}Mala Kuca","{0080C0}Interijer 1\n{0080C0}Interijer 2\n{0080C0}Interijer 3\n{0080C0}Interijer 4", "Odaberi", "Ponisti");
							}
					        SaveHouse(h);

					    }
					    else
					    {
					        SendClientMessage( playerid, WHITE, "Nemas dovoljno novcanica." );
					    }
				    }
				}
				else
				{
				    SendClientMessage( playerid, WHITE, "Zao name je, ova kuca nije dostupna za prodaju!" );
				
	    	}
		}
	}
	else
	{
	    SendClientMessage( playerid, WHITE, "Vec imas kucu! Koristi /kuca prodaj da prodas tu sto imas." );
	}
	return 1;
}