[pomoc]Komanda

Započeo Aldin Begovic, April 03, 2012, 18:00:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

mod:moj gm od 0
opis problema:Imam problema sa ovim pVarovima u ovoj komandi neznam da ih podesim lijepo pa bi molio nekog da me ispravi u ovoj komandi
cod:
COMMAND:firma(playerid, params[])
{
		new string[128];
		new x_job[128];
		new idx;
		new playername[MAX_PLAYER_NAME];
		GetPlayerName(playerid,playername,sizeof(playername));
		x_job = strtok(params, idx);
    	if(GetPVarInt(playerid, "Firma") == 255)
	    {
        SendClientMessage( playerid, WHITE, "*Nemas firmu" );
        return 1;
	    }
		if(!strlen(x_job) && GetPVarInt(playerid, "Firma") != 255 && strcmp(playername, Businesses[GetPVarInt(playerid, "Firma")][bOwner1], true) == 0)
		{
		format( string, sizeof( string ), "_______________%s______________", Businesses[GetPVarInt(playerid, "Firma")][bName]);
		SendClientMessage( playerid, 0x399CCEFF, string);
		SendClientMessage(playerid, 0x7EBEDFFF,"KORISTENJE: /firma [ime]");
		SendClientMessage(playerid, 0xA4D1E8FF,"Dostupno: informacije, ostavi, izvadi, preuredi");
		SendClientMessage(playerid, 0xBCDDEEFF,"Dostupno: naruci, otvori, zatvori, roba");
		SendClientMessage(playerid, 0xBCDDEEFF,"_____________________________");
		SendClientMessage(playerid, 0xD1E7F3FF,"Ako hoces da promijenis ime firme koristi: /imefirme [tekst]");
		SendClientMessage(playerid, 0xDBECF5FF,"Ako hoces da promijenis cijene robe u svojoj firmi koristi /cijenarobe [Artikal] [Cijena]");
			return 1;
		}
		if(!strlen(x_job) && GetPVarInt(playerid, "Firma") != 255 &&  strcmp(playername, SBusinesses[GetPVarInt(playerid, "Firma")][sbOwner1], true) == 0)
		{
		format( string, sizeof( string ), "_______________%s______________", SBusinesses[GetPVarInt(playerid, "Firma")][sbName]);
		SendClientMessage( playerid, 0x399CCEFF, string);
		SendClientMessage(playerid, 0x7EBEDFFF,"KORISTENJE: /firma [ime]");
		SendClientMessage(playerid, 0xA4D1E8FF,"Dostupno: informacije, ostavi, izvadi, preuredi");
		SendClientMessage(playerid, 0xBCDDEEFF,"Dostupno: naruci, otvori, zatvori, roba");
		SendClientMessage(playerid, 0xBCDDEEFF,"_____________________________");
		SendClientMessage(playerid, 0xD1E7F3FF,"Ako hoces da promijenis ime firme koristi: /imefirme [tekst]");
		SendClientMessage(playerid, 0xDBECF5FF,"Ako hoces da promijenis cijene robe u svojoj firmi koristi /cijenarobe [Artikal] [Cijena]");
			return 1;
		}
		if(strcmp(x_job,"otvori",true) == 0)
		{
				new gous;
				gous=GetPVarInt(playerid, "Firma");
			if( GetPVarInt(playerid, "Firma") != 255 &&  strcmp(playername, SBusinesses[GetPVarInt(playerid, "Firma")][sbOwner1], true) == 0)
			{
			SendClientMessage( playerid, WHITE, "Ne mozes ovu firmu otkljucati!" );
			return 1;
			}
		if(GetPVarInt(playerid, "Firma") != 255 && IsPlayerInRangeOfPoint( playerid, 5, Businesses[gous][bExteriorX], Businesses[gous][bExteriorY], Businesses[gous][bExteriorZ]) &&  strcmp(playername, Businesses[GetPVarInt(playerid, "Firma")][bOwner1], true) == 0)
		{
	    if(Businesses[gous][bLockStatus] == 1)
	    {
	        Businesses[gous][bLockStatus] = 0;
	        SendClientMessage( playerid, WHITE, "Firma otkljucana." );
	    }
		else { SendClientMessage( playerid, WHITE, "Firma je vec otkljucana." ); return 1;}
		}
		else { SendClientMessage( playerid, WHITE, "Nisi kod ulaza firme." ); return 1;}

		return 1;
	}
	if(strcmp(x_job,"prodaj",true) == 0)
		{
	#pragma unused params
	new bouse = GetPVarInt(playerid, "Firma");
	new souse = GetPVarInt(playerid, "Firma");
	new stringt[64];
	if( bouse != 255 &&  strcmp(playername, Businesses[GetPVarInt(playerid, "Firma")][bOwner1], true) == 0)
	{

	strmid(Businesses[bouse][bOwner1], "Niko", 0, strlen("Niko"), 255);
	Businesses[bouse][bOwnedd] = 0;
	format( stringt, sizeof( stringt ), "~y~Prodali ste firmu za: ~g~%d$", Businesses[bouse][bVault]);
    SetPVarInt(playerid, "Firma", 255);
	GivePlayerCash(playerid,Businesses[bouse][bVault]);
	Businesses[bouse][bVault] = 0;
	OnPropTextdrawUpdate();
	SaveBusiness( bouse );

	}
 	if( souse != 255 &&  strcmp(playername, SBusinesses[GetPVarInt(playerid, "Firma")][sbOwner1], true) == 0 )
	{

	strmid(SBusinesses[souse][sbOwner1], "Niko", 0, strlen("Niko"), 255);
	SBusinesses[souse][sbOwnedd] = 0;
	format( stringt, sizeof( stringt ), "~y~Prodali ste firmu za: ~g~%d$", SBusinesses[souse][sbVault]);
    SetPVarInt(playerid, "Firma", 255);
	GivePlayerCash(playerid,SBusinesses[souse][sbVault]);
	SBusinesses[souse][sbVault] = 0;
	OnPropTextdrawUpdate();
	SaveSBusiness( souse );

	}
	return 1;
	}
		if(strcmp(x_job,"zatvori",true) == 0)
		{
			new gous;
			gous=GetPVarInt(playerid, "Firma");
			if(GetPVarInt(playerid, "Firma") != 255 &&  strcmp(playername, SBusinesses[GetPVarInt(playerid, "Firma")][sbOwner1], true) == 0 )
			{
			SendClientMessage( playerid, WHITE, "Ne mozes ovu firmu zakljucati!" );
			}
		if(GetPVarInt(playerid, "Firma") != 255 &&  IsPlayerInRangeOfPoint( playerid, 5, Businesses[gous][bExteriorX], Businesses[gous][bExteriorY], Businesses[gous][bExteriorZ]) &&  strcmp(playername, Businesses[GetPVarInt(playerid, "Firma")][bOwner1], true) == 0)
		{
	    if(Businesses[gous][bLockStatus] == 0)
	    {
	        Businesses[gous][bLockStatus] = 1;
	        SendClientMessage( playerid, WHITE, "Firma zakljucana." );
	    }
		else { SendClientMessage( playerid, WHITE, "Firma je vec zakljucana." ); return 1;}
		}
		else { SendClientMessage( playerid, WHITE, "Nisi kod ulaza firme." ); return 1;}

		return 1;
	}
		if(strcmp(x_job, "ostavi", true) == 0)
					{

						new gous;
				gous=GetPVarInt(playerid, "Firma");
				new souse =GetPVarInt(playerid, "Firma");
				if(GetPVarInt(playerid, "Firma") != 255 && IsPlayerInRangeOfPoint( playerid, 5, Businesses[gous][bExteriorX], Businesses[gous][bExteriorY], Businesses[gous][bExteriorZ])  &&  strcmp(playername, Businesses[GetPVarInt(playerid, "Firma")][bOwner1], true) == 0)
				{

					temp = strtok(params, idx);
						if(!strlen(temp))
							{
							SendClientMessage(playerid, COLOR_GRAD3,"{168BFF}INFO: {959561} /firma ostavi [kolicina]");
							return 1;
						}
					    moneys = strval(temp);
					    if(GetPlayerCash(playerid) < 1)
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, " Prvo otplati dug pa dodi !");
					        return 1;
						}
						if(GetPlayerCash(playerid) < moneys)
						{
      						SendClientMessage(playerid, COLOR_GRAD1, " Nemas toliko novca kod sebe !");
					        return 1;
						}
						if(moneys > 5001 || moneys < 0)
						{
      						SendClientMessage(playerid, COLOR_GRAD1, " Ne idi ispod 0 i preko 5000 !");
					        return 1;
						}
						if(GetPlayerCash(playerid) >= moneys)
						{
						   GivePlayerCash(playerid, -moneys);
	                    Businesses[GetPVarInt(playerid, "Firma")][bVault] += moneys;
	                    format( string, sizeof( string ), "Ostavio si $%d u kasu svoje firme", moneys);
	                    SendClientMessage( playerid, WHITE, string);
						SaveBusiness(GetPVarInt(playerid, "Firma"));
						}
					}
					else if(GetPVarInt(playerid, "Firma") != 255 && IsPlayerInRangeOfPoint( playerid, 5, SBusinesses[souse][sbExteriorX], SBusinesses[souse][sbExteriorY], SBusinesses[souse][sbExteriorZ]) &&  strcmp(playername, SBusinesses[GetPVarInt(playerid, "Firma")][sbOwner1], true) == 0 )
				{

					temp = strtok(params, idx);
						if(!strlen(temp))
							{
							SendClientMessage(playerid, COLOR_GRAD3,"{168BFF}INFO: {959561} /firma ostavi [kolicina]");
							return 1;
						}
					    moneys = strval(temp);
					    if(GetPlayerCash(playerid) < 1)
					    {
					        SendClientMessage(playerid, COLOR_GRAD1, " Prvo otplati dug pa dodi !");
					        return 1;
						}
						if(GetPlayerCash(playerid) < moneys)
						{
      						SendClientMessage(playerid, COLOR_GRAD1, " Nemas toliko novca kod sebe !");
					        return 1;
						}
						if(moneys > 5001 || moneys < 0)
						{
      						SendClientMessage(playerid, COLOR_GRAD1, " Ne idi ispod 0 i preko 5000 !");
					        return 1;
						}
						if(GetPlayerCash(playerid) >= moneys)
						{
						   GivePlayerCash(playerid, -moneys);
	                    SBusinesses[GetPVarInt(playerid, "Firma")][sbVault] += moneys;
	                    format( string, sizeof( string ), "Ostavio si $%d u kasu svoje firme", moneys);
	                    SendClientMessage( playerid, WHITE, string);
						SaveSBusiness( GetPVarInt(playerid, "Firma"));
						}
					}
					}
Poslednja Izmena: April 03, 2012, 18:24:34 POSLE PODNE od Aldin Begovic

Ovo je komanda iz Noxicusa, a ne tvoja od 0 :)
Poslednja Izmena: April 03, 2012, 19:01:57 POSLE PODNE od ♥Chuck♥

Citat: ♥Chuck♥ poslato April 03, 2012, 19:01:41 POSLE PODNE
Ovo je komanda iz Noxicusa, a ne tvoja od 0 :)
Da ! Ali ne vidimm gdje sam to ja napisao da je moj sistem , i zamolio bi te da procitas prvo pa  tek onda napises odgovor !