[POMOC]Kupnja vozila

Započeo JONY, Februar 19, 2012, 19:44:02 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:BN
Detaljan opis problema:pa zelio bih u ovu komandu dodat naprimer ako je player u izlozbenom autu i sad da stavim da nemoze svako auto kupiti samo novcem nego da odrdena auta stavim da ih moze kupiti ako je donator naprimer nek unikatna vozila al da su sva istom komandom
Dio skripte: CMD:kupivozilo(playerid, params[])
{
new string[128];
new sendername[MAX_PLAYER_NAME];
    if (Spectating[playerid][0]!=-1)
    {
        if (Carlist[playerid][Typ]==-1)
        {
            new price = Buylist[Spectating[playerid][0]][Price];
            if (price <= GetPlayerCash(playerid))
            {
new autohaus=Buylist[Spectating[playerid][0]][Autohaus];
            GivePlayerCash(playerid, - price);
Carlist[playerid][Cijena] = Buylist[Spectating[playerid][0]][Price];
PlayerInfo[playerid][pVoziloSpawnano] = 0;
            Carlist[playerid][Typ]=Spectating[playerid][0]; Carlist[playerid][X]=Carspawns[autohaus][X]; Carlist[playerid][Y]=Carspawns[autohaus][Y];
Carlist[playerid][Z]=Carspawns[autohaus][Z]; Carlist[playerid][Rotation]=Carspawns[autohaus][Rotation]; Carlist[playerid][Status]=1; Carlist[playerid][Lock]=0;
Carlist[playerid][Typ] = 1;
new otext[20];
if(PlayerInfo[playerid][pOvjeraPapira] == 0) { otext = "Nema"; }
strmid(Carlist[playerid][BrojRegistracije],otext, 0, strlen(otext), 255);
SetVehicleNumberPlate(Carlist[playerid][Carid], Carlist[playerid][BrojRegistracije]);
//-------------
new string1[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string1, sizeof(string1), "%s",sendername);
strmid(Carlist[playerid][Vlasnik], string1, 0, strlen(string1), 255);

//-------------
new Vozilo;
Vozilo = GetVehicleModel(Buylist[Spectating[playerid][0]][Carid]);
Carlist[playerid][VehModel] = Vozilo;
Carlist[playerid][Cijena] = Buylist[Spectating[playerid][0]][Price];
        SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
        TogglePlayerControllable(playerid,1);
TextDrawHideForPlayer(playerid, imevozila[playerid]);
TextDrawHideForPlayer(playerid, cijenavozila[playerid]);
TextDrawHideForPlayer(playerid, registracijavozila[playerid]);
VehicleSave(playerid);
        Spectating[playerid][0]=-1;
        RemovePlayerFromVehicle(playerid);
format(string,128,"Cestitamo! Kupio si novo vozilo za za %i$!",price);
SendClientMessage(playerid, 0x8888C4FF, string);
SendClientMessage(playerid, 0x9191C8FF, "Ako ti se vozilo unisti kucaj /v popravi da ga popravis.");
SendClientMessage(playerid, 0x9B9BCDFF, "Vozila nestaju kada se diskonektujete sa servera.");
SendClientMessage(playerid, 0xA2A2D0FF, "Vracaju se nakon sto se vi konektujete.");
SendClientMessage(playerid, 0xAEAED6FF, "Ostalo: (/v)ozilo.");
SendClientMessage(playerid, 0xB9B9DBFF, "Kucaj /v spawn da spawnas vozilo, samo pazi da nema objekata u blizini.");
SendClientMessage(playerid, 0xC0C0DEFF, "Cuvaj ovo vozilo, i naravno puno srece sa njim!");
}
                else { format(string, 128, "Nemas dovoljno novca! ($%i)!", price); SendClientMessage(playerid, COLOR_LIGHTRED, string); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Vec imas vozilo"); }
    }
    else { SendClientMessage(playerid, COLOR_GREY, "Nisi u izlozbenom vozilu!"); }
    return 1;
}