[Pomoc] /kupivozilo

Započeo [UG]Cile, Januar 14, 2012, 23:06:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: CL Edit
Detaljan opis problema: Kupim vozilo, ubijem se i vrati mi se nekoliko novca od kupnje :S moze pomoc ?
Dio skripte:

   if(strcmp(cmd, "/kupivozilo", true) == 0)
   {
       if (Spectating[playerid][0]!=-1)
       {
           if (Carlist[playerid][Typ]==-1)
           {
               new price = Buylist[Spectating[playerid][0]][Price];
               if (price <= GetPlayerMoney(playerid))
               {
                   new autohaus=Buylist[Spectating[playerid][0]][Autohaus];
                    JB_GivePlayerMoney(playerid, - price);
                    Carlist[playerid][Typ] = Spectating[playerid][0]; Carlist[playerid][X3] = Carspawns[autohaus][X3]; Carlist[playerid][Y3] = Carspawns[autohaus][Y3];
               Carlist[playerid][Z3] = Carspawns[autohaus][Z3]; Carlist[playerid][Rotation] = Carspawns[autohaus][Rotation]; Carlist[playerid][Status] = 1; Carlist[playerid][Lock] = 0;
               Carlist[playerid][Carid] = CreateVehicle(Buylist[Spectating[playerid][0]][Modelid],Carlist[playerid][X3],Carlist[playerid][Y3],Carlist[playerid][Z3],Carlist[playerid][Rotation],-1,-1,-1);
                 SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
                 TogglePlayerControllable(playerid,1);
                 Spectating[playerid][0]=-1;
                 RemovePlayerFromVehicle(playerid);
                 VehicleSave(playerid);
                 TextDrawHideForPlayer(playerid, imevozila[playerid]);
               TextDrawHideForPlayer(playerid, cijenavozila[playerid]);
               TextDrawHideForPlayer(playerid, registracijavozila[playerid]);
               format(string, sizeof(string), "~w~Cestitamo~n~Kupili ste vozilo za~n~~y~~g~$%d", price);
                GameTextForPlayer(playerid, string, 10000, 3);
               SendClientMessage(playerid, NICERED, "Ako je vas auto pokvaren, upisite {FFFFFF}/v fix "COL_RED"da popravite.");
               SendClientMessage(playerid, NICERED, "Mozete otkljucati/zakljucati vas auto sa naredbom {FFFFFF}/v lock.");
               SendClientMessage(playerid, NICERED, "Ostalo: {FFFFFF}(/v)ozilo.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Vase vozilo je dostavljeno, Uzivajte!");
               SacuvajIgraca(playerid);
            }
                else { format(string, 128, "* Nedovoljno novca za kupnju automobila (trebate: {FFFFFF}$%i)!", price); SendClientMessage(playerid, YELLOW, string); }
         }
         else { SendClientMessage(playerid, COLOR_GREY, "Vi vec imate auto!"); }
       }
       else { SendClientMessage(playerid, COLOR_GREY, "Nisi u izlozbenom vozilu!"); }
       return 1;
   }

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




petricko nemam ja to, vidi

forward MoneyTimer();
public MoneyTimer()
{
   
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerCash(i) != GetPlayerMoney(i))
            {
            }
        }
    }
}





meni se desi znaci platim infernus 500k
kad se ubijem vrati mi se 100k
i kad prodam /v prodaj dobijem jos 400k
znaci vrate se one pare sto bi trebale, ajmo rec propast