Trafika

Započeo Xladen, Januar 18, 2018, 00:23:41 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Detaljan opis problema: Kada otvorim dialog i kupim nesto nista ne dobijem i ne skida mi novac.
Dio skripte:
CMD:
CMD:trafika(playerid, params[])
{

    if(UlogovanProvera[playerid] == 0) return Ulogovan(playerid);
    if(IsPlayerInAnyVehicle( playerid )) return SCM(playerid,-1,""CRVENA"[GRESKA] "BELA"Moras biti van vozila!");
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -2540.9431, 2292.0476, 4.9844) || IsPlayerInRangeOfPoint(playerid, 2.0, -2278.4382, 2312.0273, 4.9659) || IsPlayerInRangeOfPoint(playerid, 2.0, -2565.6521, 2469.9983, 19.4087) || IsPlayerInRangeOfPoint(playerid, 2.0, -1472.1143, 2642.0332, 55.8359) || IsPlayerInRangeOfPoint(playerid, 2.0, -1525.1388, 2544.7451, 55.8359))
	SPD(playerid, DIALOG_TRAFIKA, DIALOG_STYLE_LIST, ""BELA"Trafika", ""HZELENA"- "BELA"Dopuna (20$)\n"HZELENA"- "BELA"Dopuna (50$)\n"HZELENA"- "BELA"Dopuna (100$)\n"HZELENA"- "BELA"Sok (10$)\n"HZELENA"- "BELA"Cigare (20$)\n"HZELENA"- "BELA"Upaljac (10$)\n"HZELENA"- "BELA"Cokoladica (10$)\n"HZELENA"- "BELA"Mp3 (100$)\n", "Odaberi", "Izlaz");
    else return SCM(playerid,-1,""CRVENA"[GRESKA] "BELA"Nisi kod trafike!");
	return 1;
}

DIALOG:
    if(dialogid == DIALOG_TRAFIKA)
	{
		if(!response) return 1;
		if(FirmaInfo[KioskKupovina[playerid]][fProizvodi] <= 0) return SCM(playerid,-1,""ZPLAVA"[Trafika]: "BELA"Nemamo vise proizvoda!");
		FirmaInfo[KioskKupovina[playerid]][fProizvodi]--;
		switch(listitem)
		{
			case 0:
			{
				if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""HZELENA"[BE:RPBE:RP] "SIVA"Nemate mobilni telefon!");
			   	if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste 20 kredita za 20$!");
				PlayerInfo[playerid][pMobKredit] += 20;
				g_NovacMinus(playerid,20);
				FirmaNovac(KioskKupovina[playerid],20);
				SavePlayer(playerid);
			}
			case 1:
			{
				if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate mobilni telefon!");
			   	if(PlayerInfo[playerid][pNovacDzep] < 50) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste 50 kredita za 50$!");
				PlayerInfo[playerid][pMobKredit] += 50;
				g_NovacMinus(playerid,50);
				FirmaNovac(KioskKupovina[playerid],50);
				SavePlayer(playerid);
			}
			case 2:
			{
			    if(PlayerInfo[playerid][pMobilni] == 0) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate mobilni telefon!");
			   	if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 100$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste 100 kredita za 100$!");
				PlayerInfo[playerid][pMobKredit] += 100;
				g_NovacMinus(playerid,100);
				FirmaNovac(KioskKupovina[playerid],100);
				SavePlayer(playerid);
			}
			case 3:
			{
			   	if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""HZELENA"[BE]"SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste sok za 10$!");
                SetPlayerSpecialAction( playerid, SPECIAL_ACTION_DRINK_SPRUNK);
				g_NovacMinus(playerid,10);
				FirmaNovac(KioskKupovina[playerid],10);
			}
			case 4:
			{
				if(PlayerInfo[playerid][pCigare] != 0) return SCMF(playerid,-1,""HZELENA"[BE] "SIVA"Vec imas %d cigara prvo ih popusi!",PlayerInfo[playerid][pCigare]);
			   	if(PlayerInfo[playerid][pNovacDzep] < 20) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 20$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste cigare | Sada mozete zapliti cigaru (/zapalicigaru | /ugasicigaru)!");
				PlayerInfo[playerid][pCigare] = 20;
				g_NovacMinus(playerid,20);
				FirmaNovac(KioskKupovina[playerid],20);
				SavePlayer(playerid);
			}
			case 5:
			{
				if(PlayerInfo[playerid][pUpaljac] == 1) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Vec posedujes upaljac!");
			   	if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 10$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste upaljac za 10$!");
				PlayerInfo[playerid][pUpaljac] = 10;
				g_NovacMinus(playerid,10);
				FirmaNovac(KioskKupovina[playerid],10);
				SavePlayer(playerid);
			}
			case 6:
			{
			    new string[128];
			    if(PlayerInfo[playerid][pNovacDzep] < 10) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 10$!");
			    new Float:hp, Float:nhp; GetPlayerHealth(playerid, hp);
				nhp = floatadd(hp, 10.0); g_SetPlayerHealth(playerid, nhp);
				if(nhp > 99.0) g_SetPlayerHealth(playerid, 99.0);
				if(nhp >= 99.0) return SCM(playerid,-1,"[BE] "HZELENA"Niste gladni!");
				format(string, sizeof(string), "* %s jede cokoladicu.", GetName(playerid));
			    ProxDetector(15.0, playerid, string, PROX,PROX,PROX,PROX,PROX);
			    OnePlayAnim(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
			    g_NovacMinus(playerid,10);
				FirmaNovac(KioskKupovina[playerid],10);
			}
			case 7:
			{
				if(PlayerInfo[playerid][pMp3] == 1) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Vec posedujes mp3!");
			   	if(PlayerInfo[playerid][pNovacDzep] < 100) return SCM(playerid,-1, ""HZELENA"[BE] "SIVA"Nemate dovoljno novca 50$!");
                SCM(playerid,-1,""ZUTA"[INFO] "SIVA"Kupili ste mp3 za 100$ | koriscenje : /mp3 !");
				PlayerInfo[playerid][pMp3] = 1;
				g_NovacMinus(playerid,100);
				FirmaNovac(KioskKupovina[playerid],100);
				SavePlayer(playerid);
			}
		}
	}

Neke slike/video za lakse dobivanje pomoci(neobavezno):