[Pomoc] Vlasnik vozila

Započeo Lemi_Zero, Decembar 13, 2011, 14:27:20 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Lemi_Zero

Skripta koju koristim: Moja skripta
Detaljan opis problema: Kako da namestim ako neko ima svoj auto,motor,plovilo ili letjelicu da ako drugi igrac oce da udje u auto,motor,plovilo,letjelicu da mu pise gore u chatu Zakljucano. Vlasnik: Ime_Prezime ?? moze pomoc plss :) ako moze tako i za ostala vozila. hvala ;)
Dio skripte: //
Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Poslednja Izmena: Decembar 13, 2011, 14:28:38 POSLE PODNE od Lemi_Zero

pa jel imas kaki sistem vozila ili mi sami moramo funkcije izvlacit?
Vratio sam se ponovo ocekjute novi server...

Lemi_Zero

Imam komandu /v ako ti to nesto znaci evo...

/V
if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vozilo", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Morate se prvo prijaviti ! ");
            return 1;
        }
        new x_nr[256];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
{
new porukaV[] = ""COL_RED"(/v)ozilo:\n\n {FFFFFF}- prodaj, oboji, lociraj, park, lock\n - fix, repaint, /napusti\n - /kupivozilo, /prodajvozilo, /cancelsell, /prihvatisell";
format(string, sizeof(string),"%s ",porukaV);
ShowPlayerDialog(playerid, 98, DIALOG_STYLE_MSGBOX,"{00C0FF}Opcije Vozila",string,"U redu","");
return 1;
}
if(strcmp(x_nr,"park",true) == 0)
{
if (IsPlayerInVehicle(playerid,Carlist[playerid][Carid]))
{
    GetVehiclePos(Carlist[playerid][Carid],Carlist[playerid][X3],Carlist[playerid][Y3],Carlist[playerid][Z3]);
    GetVehicleZAngle(Carlist[playerid][Carid],Carlist[playerid][Rotation]);
    new componentid = GetModType(componentid);
OnVehicleMod(playerid,Carlist[playerid][Carid],componentid);
VehicleSave(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "Tvoje ce se vozilo odsada ovdje spawnati");
}
else { SendClientMessage(playerid, COLOR_GREY, "Ovo nije vase vozilo!"); }
return 1;
}
else if(strcmp(x_nr,"fix",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
if (Carlist[playerid][Status]==0)
{
    new reparatur = Buylist[Carlist[playerid][Typ]][Repair];
if (reparatur <= GetPlayerMoney(playerid))
{
    Carlist[playerid][Status]=1;
    Carlist[playerid][Carid]=CreateTunedCar(playerid);
GivePlayerMoney(playerid, - reparatur);
format(string, 128, "* Cijena popravka auta iznosi {FFFFFF}$%i! "COL_YELLOW"Automobil je dostavljen na vase parking mjesto!.", reparatur);
SendClientMessage(playerid, YELLOW, string);
}
else { format(string, 128, "* Nedovoljno novca za popravak! (Potrebno: {FFFFFF}$%i)!", reparatur); SendClientMessage(playerid, YELLOW, string); }
}
        else { SendClientMessage(playerid, COLOR_GREY, "Vase vozilo ne treba popravak!"); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes vozilo!"); }
return 1;
}
else if(strcmp(x_nr,"lock",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
if (Carlist[playerid][Carid]!=-1)
{
if (Carlist[playerid][Lock]==0)
{
    Carlist[playerid][Lock]=1;
    SetVehicleParamsForAll(Carlist[playerid][Carid],0,1);
    SetVehicleParamsForPlayer(Carlist[playerid][Carid],playerid,0,0);
SendClientMessage(playerid, YELLOW, "* Vase vozilo je zakljucano!");
SendClientMessage(playerid, YELLOW, "* Samo vi mozete uci u njega!");
}
else
{
    Carlist[playerid][Lock]=0;
    SetVehicleParamsForAll(Carlist[playerid][Carid],0,0);
    SendClientMessage(playerid, YELLOW, "* Vase vozilo je otkljucano!");
SendClientMessage(playerid, YELLOW, "Sada svi mogu uci u njega!");
}
}
else { SendClientMessage(playerid, COLOR_GREY, "* Vase vozilo je pokvareno! Popravite ga!"); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes vozilo!"); }
    return 1;
}
else if(strcmp(x_nr,"oboji",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
if (Carlist[playerid][Carid]!=-1)
{
    ChangeVehicleColor(Carlist[playerid][Carid],Carlist[playerid][Color1],Carlist[playerid][Color2]);
    VehicleSave(playerid);
    SendClientMessage(playerid, ZUTA, "* Prebojali ste automobil!");
    }
else { SendClientMessage(playerid, COLOR_GREY, "Vase vozilo je pokvareno! Popravite ga!"); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes vozilo!"); }
    return 1;
}
else if(strcmp(x_nr,"repaint",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
if (Carlist[playerid][Carid]!=-1)
{
    if (Carlist[playerid][Paintjob]!=-1)
    {
    ChangeVehiclePaintjob(Carlist[playerid][Carid],Carlist[playerid][Paintjob]);
        SendClientMessage(playerid, COLOR_YELLOW, "* Iscrtali ste vas automobil!");
}
else { SendClientMessage(playerid, COLOR_GREY, "Vase vozilo nema Paintjob!"); }
    }
else { SendClientMessage(playerid, COLOR_GREY, "Vase vozilo je pokvareno! Popravite ga!"); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Ne posjedujes vozilo!"); }
    return 1;
}
else if(strcmp(x_nr,"prodaj",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
        new price = (Buylist[Carlist[playerid][Typ]][Price]/5)*4;
        if (IsPlayerInVehicle(playerid,Carlist[playerid][Carid])) { RemovePlayerFromVehicle(playerid); }
        GivePlayerMoney(playerid, price);
        DestroyVehicle(Carlist[playerid][Carid]);
Carlist[playerid][Typ]=-1; Carlist[playerid][X3]=0.0; Carlist[playerid][Y3]=0.0; Carlist[playerid][Z3]=0.0;
Carlist[playerid][Rotation]=0.0; Carlist[playerid][Status]=0; Carlist[playerid][Lock]=0; Carlist[playerid][Carid]=-1;
Carlist[playerid][Color1]=-1; Carlist[playerid][Color2]=-1; Carlist[playerid][mod1]=-1; Carlist[playerid][mod2]=-1;
Carlist[playerid][mod3]=-1; Carlist[playerid][mod4]=-1; Carlist[playerid][mod5]=-1; Carlist[playerid][mod6]=-1;
Carlist[playerid][mod7]=-1; Carlist[playerid][mod8]=-1; Carlist[playerid][mod9]=-1; Carlist[playerid][mod10]=-1;
Carlist[playerid][mod11]=-1; Carlist[playerid][mod12]=-1; Carlist[playerid][mod13]=-1; Carlist[playerid][mod14]=-1;
Carlist[playerid][mod15]=-1; Carlist[playerid][mod16]=-1; Carlist[playerid][mod17]=-1; Carlist[playerid][Paintjob]=-1;
SacuvajIgraca(playerid);
VehicleSave(playerid);
format(string,128,"* Uspjesno si prodao automobil za {FFFFFF}$%i!",price);
SendClientMessage(playerid, YELLOW, string);
    }
    else { SendClientMessage(playerid, COLOR_GREY, "Vi nemate auto!"); }
    return 1;
}
else if(strcmp(x_nr,"lociraj",true) == 0)
{
    if (Carlist[playerid][Typ]!=-1)
    {
        if(cartrack[playerid] == 0)
{
new Float:x, Float:y, Float:z;
GetVehiclePos(Carlist[playerid][Carid], x, y, z);
SetPlayerCheckpoint(playerid,x,y,z, 6.0);
SendClientMessage(playerid, YELLOW, "* Lokacija tvog {FFFFFF}vozila "COL_YELLOW"je postavljena na mapi!");
cartrack[playerid] = 1;
}
else
{
    SendClientMessage(playerid, COLOR_WHITE, "Otkazano.");
}
}
else
{
    SendClientMessage(playerid, COLOR_GRAD2, "Ne posedujes vozilo!");
    return 1;
}
return 1;
}
}
return 1;
}

znaci pod ovaj callback OnPlayerStateChange

radis za to..

if(newstate == PLAYER_STATE_DRIVER)
{
    new veh = GetPlayerVehicleID(playerid);
if(KupljenoVozilo[veh] == 1)
{
    new vlasnik[24], string[128];
    GetPlayerName(VoziloID[veh], vlasnik, sizeof(vlasnik));
format(string, sizeof(string), "[INFO]: Ovo vozilo je u vlasništvu %s.", vlasnik);
    SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
}


evo ti ovako ti ubaci svoja imena itd.. nadam se da ces skuzit
Vratio sam se ponovo ocekjute novi server...

Lemi_Zero

Nasao sam ovo:
if(newstate == PLAYER_STATE_DRIVER)
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new name[256];
GetPlayerName(playerid, name, sizeof(name));

new vehicleid = GetPlayerVehicleID(playerid);
new typ;
typ = IsAutohausCar(vehicleid);
if(typ!=-1)


Jel mozes da me add na skype pa da tamo pricamo i da mi objasnis pls ?? (milan.nesic2009)

Citat: Lemi_Zero poslato Decembar 13, 2011, 15:38:49 POSLE PODNE
Nasao sam ovo:
if(newstate == PLAYER_STATE_DRIVER)
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new name[256];
GetPlayerName(playerid, name, sizeof(name));

new vehicleid = GetPlayerVehicleID(playerid);
new typ;
typ = IsAutohausCar(vehicleid);
if(typ!=-1)


Jel mozes da me add na skype pa da tamo pricamo i da mi objasnis pls ?? (milan.nesic2009)
daj mi posalji na pm taj callback cijeli i pomocu ti na pm ovdje nek lockaju...
PS: neam skype..
Vratio sam se ponovo ocekjute novi server...

Lemi_Zero

Nekontam sta treba da ti posaljem ???

Mozes malo bolje objasniti pls  :(

Citat: Lemi_Zero poslato Decembar 13, 2011, 15:46:24 POSLE PODNE
Nekontam sta treba da ti posaljem ???

Mozes malo bolje objasniti pls  :(

posalji ovaj callback OnPlayerStateChange

ali ja ode sad dodem kasnije ap ti namjestim...
Vratio sam se ponovo ocekjute novi server...

Lemi_Zero

Evo ti sve sto sam nasao pod tim "OnPlayerStateChange"
Ima puno toga pa ti brobaj nekako da nadjes to :P

public OnPlayerStateChange(playerid, newstate, oldstate)
{
new string[256];
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new vehicle = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
{
SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
SetTimerEx("engine2", 2500, false, "ii", playerid);
}
else if(newstate == PLAYER_STATE_DRIVER && (pveh != 509 && pveh != 481 && pveh != 510) && IsPlayerInAnyVehicle(playerid) && !IsAPlane(vehicle) && !IsAHarvest(vehicle) && !IsADrugHarvest(vehicle) && !IsASweeper(vehicle))
{
SetTimerEx("Startup", 1, false, "ii", playerid, vehicle);
SetTimerEx("engine2", 2500, false, "ii", playerid);
}
if(newstate == PLAYER_STATE_ONFOOT)
{
    if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
{
    PlayerInKart[playerid] = 0;
    KartingPlayers --;
}
    if(TransportDuty[playerid] > 0)
{
    if(TransportDuty[playerid] == 1)
{
        TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
    BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* Vise niste na duznosti i zaradili ste $%d.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_WHITE, string);
GivePlayerCash(playerid, TransportMoney[playerid]);
TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
    if(IsPlayerConnected(TransportDriver[playerid]))
{
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), "~w~Voznja kosta~n~~r~$%d",TransportCost[playerid]);
    GameTextForPlayer(playerid, string, 5000, 1);
    format(string, sizeof(string), "~w~Putnik je napustio taxi~n~~g~Zaradili ste $%d",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
GivePlayerCash(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
//svjetla
if (newstate == PLAYER_STATE_DRIVER)
{
    if (VehicleLightsOn[GetPlayerVehicleID(playerid)] == false)
    {
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
        UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(1, 1, 1, 1), tires);
    VehicleLightsOn[GetPlayerVehicleID(playerid)] = false;
    }
    else
    {
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, lights, tires);
        UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), panels, doors, encode_lights(0, 0, 0, 0), tires);
          VehicleLightsOn[GetPlayerVehicleID(playerid)] = true;
}
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new vehicleid = GetPlayerVehicleID(playerid);
foreach (Player, i)
{
            if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
            {
                if(GetPlayerMoney(playerid) < TransportValue[i])
                {
                    format(string, sizeof(string), "* Treba vam $%d da biste usli.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
RemovePlayerFromVehicle(playerid);
                }
                else
                {
                    if(TransportDuty[i] == 1)
                    {
                        format(string, sizeof(string), "* Platili ste $%d taxisti.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Putnik %s je usao u vas Taxi.", name);
SendClientMessage(i, COLOR_WHITE, string);
TransportTime[i] = 1;
                  TransportTime[playerid] = 1;
                    TransportCost[playerid] = TransportValue[i];
                    TransportCost[i] = TransportValue[i];
                    TransportDriver[playerid] = i;
                    }
                    else if(TransportDuty[i] == 2)
                    {
                        format(string, sizeof(string), "* Platili ste $%d vozacu busa.", TransportValue[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Putnik %s je usao u vas Bus.", name);
SendClientMessage(i, COLOR_WHITE, string);
                    }
GivePlayerCash(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
                }
            }
    }
}
if(newstate == PLAYER_STATE_WASTED)
{
if(WantedLevel[playerid] >= 1)
{
    new price = WantedLevel[playerid] * 1000;
new count;
foreach (Player, i)
{
    if(gTeam[i] == 2 && CrimInRange(30.0, playerid,i))
    {
count = 1;
format(string, sizeof(string), "~w~Running Suspect~r~Killed");
GameTextForPlayer(i, string, 5000, 1);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
if(count == 1)
{
GivePlayerCash(playerid, - price);
PlayerInfo[playerid][pWantedDeaths] += 1;
PlayerInfo[playerid][pJailed] = 1;
    PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid])*(600);
    format(string, sizeof(string), "* U zatvoru ste na %d Sekundi i izgubili ste $%d jer ste bjezali i oboreni ste od strane policajca.", PlayerInfo[playerid][pJailTime], price);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
    WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
}
}
}

if(newstate == PLAYER_STATE_DRIVER)
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new name[256];
GetPlayerName(playerid, name, sizeof(name));

new vehicleid = GetPlayerVehicleID(playerid);
new typ;
typ = IsAutohausCar(vehicleid);
if(typ!=-1)
{
TogglePlayerControllable(playerid,0);
Spectating[playerid][0]=typ;
SetVehicleParamsForAll(vehicleid,0,1);

imevozila[playerid] = TextDrawCreate(497.000000, 150.000000, "~g~Vozilo:~w~Infernus");
TextDrawBackgroundColor(imevozila[playerid], 255);
TextDrawFont(imevozila[playerid], 1);
TextDrawLetterSize(imevozila[playerid], 0.450000, 2.300000);
TextDrawColor(imevozila[playerid], -1);
TextDrawSetOutline(imevozila[playerid], 0);
TextDrawSetProportional(imevozila[playerid], 1);
TextDrawSetShadow(imevozila[playerid], 1);
TextDrawUseBox(imevozila[playerid], 1);
TextDrawBoxColor(imevozila[playerid], 62);
TextDrawTextSize(imevozila[playerid], 640.000000, -11.000000);

cijenavozila[playerid] = TextDrawCreate(497.000000, 175.500000, "~g~Cijena: ~w~1000000");
TextDrawBackgroundColor(cijenavozila[playerid], 255);
TextDrawFont(cijenavozila[playerid], 1);
TextDrawLetterSize(cijenavozila[playerid], 0.450000, 2.300000);
TextDrawColor(cijenavozila[playerid], -1);
TextDrawSetOutline(cijenavozila[playerid], 0);
TextDrawSetProportional(cijenavozila[playerid], 1);
TextDrawSetShadow(cijenavozila[playerid], 1);
TextDrawUseBox(cijenavozila[playerid], 1);
TextDrawBoxColor(cijenavozila[playerid], 62);
TextDrawTextSize(cijenavozila[playerid], 650.000000, 0.000000);

registracijavozila[playerid] = TextDrawCreate(497.000000, 201.000000, "~r~Neregistrovan");
TextDrawBackgroundColor(registracijavozila[playerid], 255);
TextDrawFont(registracijavozila[playerid], 1);
TextDrawLetterSize(registracijavozila[playerid], 0.420000, 2.200000);
TextDrawColor(registracijavozila[playerid], -1);
TextDrawSetOutline(registracijavozila[playerid], 0);
TextDrawSetProportional(registracijavozila[playerid], 1);
TextDrawSetShadow(registracijavozila[playerid], 1);
TextDrawUseBox(registracijavozila[playerid], 1);
TextDrawBoxColor(registracijavozila[playerid], 62);
TextDrawTextSize(registracijavozila[playerid], 650.000000, 0.000000);

TextDrawShowForPlayer(playerid, imevozila[playerid]);
TextDrawShowForPlayer(playerid, cijenavozila[playerid]);
TextDrawShowForPlayer(playerid, registracijavozila[playerid]);

format(string,256,"~r~Vozilo:~w~%s",Buylist[typ][Name]);
TextDrawSetString(imevozila[playerid], string);
    format(string,256,"~r~Cijena:~w~$%i",Buylist[typ][Price]);
TextDrawSetString(cijenavozila[playerid], string);
format(string,256,"~r~Popravak:~w~%i$~n~~w~/kupivozilo",Buylist[typ][Repair]);
TextDrawSetString(registracijavozila[playerid], string);
}
new btyp;
btyp = IsAutohausBike(vehicleid);
if(btyp!=-1)
{
TogglePlayerControllable(playerid,0);
bSpectating[playerid][0]=btyp;
SetBikeParamsForAll(vehicleid,0,1);

format(string, sizeof(string), ""COL_SVPLAVA"Motor: {FFFFFF}%s\n"COL_SVPLAVA"Cijena: {FFFFFF}%i\n"COL_SVPLAVA"Popravak: {FFFFFF}%i\nKupnja:\n{FFFFFF}/kupimotor",BikeBuylist[btyp][bName],BikeBuylist[btyp][Price],BikeBuylist[btyp][Repair]);
ShowPlayerDialog(playerid, 78, DIALOG_STYLE_MSGBOX,"{F81414}MotoSalon",string,"U redu","");
}
new pltyp;
pltyp = IsAutohausBoat(vehicleid);
if(pltyp!=-1)
{
TogglePlayerControllable(playerid,0);
    BrodSpectating[playerid][0]=pltyp;
    SetBoatParamsForAll(vehicleid,0,1);

    format(string, sizeof(string), ""COL_YELLOW"Plovilo: {FFFFFF}%s\n"COL_YELLOW"Cijena: {FFFFFF}%i\n"COL_YELLOW"Popravak: {FFFFFF}%i\n"COL_YELLOW"Kupnja:\n{FFFFFF}/kupiplovilo",BoatBuylist[pltyp][plName],BoatBuylist[pltyp][Price],BoatBuylist[pltyp][Repair]);
ShowPlayerDialog(playerid, 81, DIALOG_STYLE_MSGBOX,""COL_YELLOW"SalonPlovila",string,"U redu","");
}
new letyp;
letyp = IsAutohausPlane(vehicleid);
if(letyp!=-1)
{
TogglePlayerControllable(playerid,0);
planeSpectating[playerid][0]=letyp;
SetPlaneParamsForAll(vehicleid,0,1);

format(string, sizeof(string), ""COL_ZELENA"Letjelica: {FFFFFF}%s\n"COL_ZELENA"Cijena: {FFFFFF}%i\n"COL_ZELENA"Popravak: {FFFFFF}%i\n"COL_ZELENA"Kupnja:\n{FFFFFF}/kupiletjelicu",planeBuylist[letyp][leName],planeBuylist[letyp][Price],planeBuylist[letyp][Repair]);
ShowPlayerDialog(playerid, 80, DIALOG_STYLE_MSGBOX,""COL_ZELENA"Salon Letjelica",string,"U redu","");
}
if(IsABoat(newcar))
{
    if(PlayerInfo[playerid][pBoatLic] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Neznate da plovite pa ste napustili brod !");
    RemovePlayerFromVehicle(playerid);
    TogglePlayerControllable(playerid, 1);
}
}
else if(IsAPlane(newcar))
{
    if(PlayerInfo[playerid][pFlyLic] < 1)
{
    if(TakingLesson[playerid] == 1) { }
    else {
    SendClientMessage(playerid, COLOR_GREY, "Neznate da letite pa ste napustili avion/heli!");
    RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1); }
}
}
else
{
if(PlayerInfo[playerid][pCarLic] < 0)
{
    if(PlayerDrunk[playerid] >= 5)
{
    WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Voznja u pijanom stanju");
}

}
else if(PlayerDrunk[playerid] >= 5)
{
    WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Voznja u pijanom stanju");
}

if(PlayerInfo[playerid][pCarLic] < 1)
{
    if(IsABike(newcar) || IsAOBike(newcar)) { }
    else
    {
                /*if(PlayerInfo[playerid][pCarLic] < 1)
{
    WantedPoints[playerid] += 1;
SetPlayerCriminal(playerid,255, "Driving without License");
}*/
if(TakingLesson[playerid] == 1) { }
else {
SendClientMessage(playerid, WHITE, "("COL_YELLOW"Upozorenje{FFFFFF}!) Nemate dozvolu za voznju! Vozite pazljivo i izbjegavajte "COL_RED"Policiju.");
              }
}
}
} //Done with car check
//-----------mojeauto-----------//
new PlayerName[24];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        if(newstate == PLAYER_STATE_DRIVER)
        {
           new Vehicle = GetPlayerVehicleID(playerid);
           if(Vehicle == berinoauto)
           {
              if(strcmp(PlayerName,"Don_Makaveli",true)) //Provjerava dali je igrac taj i taj
              {
                 RemovePlayerFromVehicle(playerid); //Izbacuje igraca iz auta,ako nije Don Tut By:SoaD da znate HEHE
                 SendClientMessage(playerid, COLOR_GREY, "Ovo vozilo moze voziti jedino {FFFFFF}Don Makaveli"); //Izbacuje poruku
              }
           }
        }
//-----------mojeauto-----------//
if(IsACopCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1) { }
    else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Policiske Uprave.");
}
}
if(IsATank(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 3) { }
    else
{
RemovePlayerFromVehicle(playerid);
}
}
if(IsAnFbiCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan F.B.I-a.");}
}
if(IsNgCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan S.W.A.T-a.");}
}
if(IsAGovernmentCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 3||PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 7||PlayerInfo[playerid][pMember] == 7) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");}
}
if(IsAHspdCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 2||PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pRank] > 2) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");}
}
else if(IsAnAmbulance(newcar))
{
    if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4) { }
    else { RemovePlayerFromVehicle(playerid); }
}
if(IsAHitmanCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 8||PlayerInfo[playerid][pMember] == 8) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Hitman Agencije.");}
}
if(IsALcnCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan L.C.N-a.");}
}
if(IsAGsfcar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 15 ||PlayerInfo[playerid][pMember] == 15) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan G.S.F-a.");}
}
if(IsADilercar(newcar))
{
            if(PlayerInfo[playerid][pJob] == 4) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nisi Diler Droge ovo vozilo mogu voziti samo Dileri Droge.");}
}
if(IsAAdmincar(newcar))
{
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 1339 || PlayerInfo[playerid][pGameSage] >= 1 && PlayerInfo[playerid][pGameSage] < 5) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");}
}
if(IsAShcar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 13 ||PlayerInfo[playerid][pMember] == 13) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Los Surenos-a.");}
}
if(IsACRacercar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 14 ||PlayerInfo[playerid][pMember] == 14) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Carbon Racer's-a.");}
}
if(IsASrcar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 16||PlayerInfo[playerid][pMember] == 16) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Vagos-a");}
}
if(IsAYakuzaCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 5||PlayerInfo[playerid][pMember] == 5) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Yakuza.");}
}
if(IsABallasCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 12||PlayerInfo[playerid][pMember] == 12) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Ballas-a.");}
}
if(IsACnnCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9){ }
else{
            RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan CNN-a.");}
}
if(IsAnTaxiCar(newcar))
{
    if(PlayerInfo[playerid][pLeader] == 10||PlayerInfo[playerid][pMember] == 10) { }
    else{
RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, SIVA, "(Izbacen!) Niste clan Taxi Kompanije.");}
       
}
if(IsADonatorCar(newcar)) //donatorska auta
{
    if(PlayerInfo[playerid][pDonateRank] >= 1) { }
    else{
            RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, SIVA, "(Izbacen!) Morate biti Donator da bi mogli vozit ovo auto!");}
}
//gigi test rad za smugler car
if(IsASmuggleCar(newcar))
{
    if(PlayerInfo[playerid][pJob] == 20) { }
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");}
}
if(IsAPizzabike(newcar))
{
    if(PlayerInfo[playerid][pJob] == 17)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/duty /sellpizza");
}
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog motora.");}
}
if(IsAPostarvozilo(newcar))
{
if(PlayerInfo[playerid][pJob] == 25)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/posta");
}
else {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, SIVA, "(Izbacen!) Nisi zaposlen kao postar!");}
}
if(IsAVozilovoz(newcar))
{
if(PlayerInfo[playerid][pJob] == 26)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/vlak");
}
else {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, SIVA, "(Izbacen!) Nisi zaposlen kao vlakovodja!");}
}
if(IsABus(newcar))
{
    if(PlayerInfo[playerid][pJob] == 14)
{
SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/fare /bus");
new routezonecheck = IsInBusrouteZone(playerid);
if (routezonecheck == 0) SendClientMessage(playerid, WHITE, "("COL_ORANGE"Obavijest{FFFFFF}!) Vasa najbliza ruta je "COL_ORANGE"istocna.");
else if (routezonecheck == 1) SendClientMessage(playerid, WHITE, "("COL_ORANGE"Obavijest{FFFFFF}!) Vasa najbliza ruta je "COL_ORANGE"zapadna.");
}
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog busa.");}
}
if(IsATowcar(newcar))
{
    if(PlayerInfo[playerid][pJob] == 7)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/repair /refill /duty /automehanicar");
}
    else {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");}
}
if(IsATruck(newcar))
{
    if(PlayerInfo[playerid][pJob] == 16)
{
format(string, sizeof(string), "Produkti: %d/%d", PlayerHaul[newcar][pLoad],PlayerHaul[newcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!)Produkte dostavljate po Los Santos Firma-ma.");
SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/load /kupipodukte /prodajprodukte");
}
else
{
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");
}
}
if(IsASweeper(newcar))
{
    if(PlayerInfo[playerid][pJob] == 21)
    {
        if(PlayerIsSweeping[playerid] == 0)
        {
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/cisti");
}
else
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Da zavrsis pisi: "svpl"/zaustaviciscenje.");
}
    }
    else
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila.");
    }
}
if(IsADjubretar(newcar))
{
    if(PlayerInfo[playerid][pJob] == 21)
    {
        if(PlayerIsSweeping[playerid] == 0)
        {
        TogglePlayerControllable(playerid, 0);
        SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/kupismece");
}
else
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Da zavrsis pisi: "svpl"/ponisti.");
}
    }
    else
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid, COLOR_GREY,"Nemate kljuceve od ovog vozila.");
    }
}
//---------------
     
if(IsARentCar(newcar))
{
if (HireCar[playerid] != newcar)
{
format(string,sizeof(string),"{00C0FF}Ovo se vozilo iznajmljuje.\nDa iznajmis pisi: {FFFFFF}/rentcar.\n{00C0FF}Da napustis vozilo {FFFFFF}/exit.\n{00C0FF}Cijena: {FFFFFF}250$.");
ShowPlayerDialog(playerid, 44, DIALOG_STYLE_MSGBOX,"{F81414}Auto Rent",string,"U redu","");
TogglePlayerControllable(playerid, 0);

}
}
if(IsARentBike(newcar))
{
    if (HireCar[playerid] != newcar)
{
format(string, sizeof(string), "{00C0FF}Ovaj se motor iznajmljuje.\nDa iznajmis pisi: {FFFFFF}/rentmoto.\n{00C0FF}Da napustis motor {FFFFFF}/exit.\n{00C0FF}Cijena: {FFFFFF}%d$.",SBizzInfo[0][sbEntranceCost]);
ShowPlayerDialog(playerid, 42, DIALOG_STYLE_MSGBOX,"{F81414}Moto Rent",string,"U redu","");
TogglePlayerControllable(playerid, 0);

}
}
if(IsAHarvest(newcar))
{
if(PlayerInfo[playerid][pJob] == 18)
{
    if(FarmerVar[playerid] == 0)
    {
        SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/kosenje");
    TogglePlayerControllable(playerid, 0);
}
else { }
}
else
{
    SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila!");
    RemovePlayerFromVehicle(playerid);
}
}
if(IsADrugHarvest(newcar))
{
if(PlayerInfo[playerid][pJob] == 19)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/kosi");
    TogglePlayerControllable(playerid, 0);
}
else
{
    SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila !");
    RemovePlayerFromVehicle(playerid);
}
}
if(IsAConstructionCar(newcar))
{
if(PlayerInfo[playerid][pJob] == 11)
{
    SendClientMessage(playerid, WHITE, "("svpl"Pomoc{FFFFFF}!) Komanda posla: "svpl"/prevoz");
    TogglePlayerControllable(playerid, 0);
}
else
{
    SendClientMessage(playerid, SIVA, "(Izbacen!) Nemate kljuceve od ovog vozila !");
    RemovePlayerFromVehicle(playerid);
}
}
if(oldcar != 330)
{
if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
{
if(gLastDriver[oldcar] == playerid && oldcar != newcar)
{
gLastDriver[oldcar] = 329;
gCarLock[oldcar] = 0;
UnLockCar(oldcar);
}
}
}
}
if(newstate == PLAYER_STATE_SPAWNED)
{
new Float: lwx, Float:lwy, Float:lwz;
GetPlayerPos(playerid, lwx, lwy, lwz);
if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || PlayerToPoint(1000.0, playerid, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
{
SetPlayerSpawn(playerid);
}
if(WantedPoints[playerid] > 0)
{
    new dstring[128];
new wanted = WantedPoints[playerid];
new diecash = 0;
    while(WantedPoints[playerid] > 0)
    {
        diecash += 500;
        WantedPoints[playerid] --;
    }
    format(dstring, sizeof(dstring), "Izgubili ste $%d zbog umiranja sa %d Wanted Poena/om.", diecash, wanted);
    SendClientMessage(playerid, COLOR_YELLOW, dstring);
    GivePlayerCash(playerid, - diecash);
    PlayerInfo[playerid][pWantedDeaths] += 1;
}
if(PlayerOnMission[playerid] > 0)
{
GameTextForPlayer(playerid, "~r~Misija je izgubljena", 5000, 3);
PlayerOnMission[playerid] = 0;
    PlayerInfo[playerid][pMissionNr] = 0;
}
WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); }
MedicBill[playerid] = 1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
gPlayerSpawned[playerid] = 1;
SafeTime[playerid] = 60;
}
return 1;
}

Citat: Narco_VK poslato Decembar 13, 2011, 15:31:13 POSLE PODNE
znaci pod ovaj callback OnPlayerStateChange

radis za to..

if(newstate == PLAYER_STATE_DRIVER)
{
    new veh = GetPlayerVehicleID(playerid);
if(KupljenoVozilo[veh] == 1)
{
    new vlasnik[24], string[128];
    GetPlayerName(VoziloID[veh], vlasnik, sizeof(vlasnik));
format(string, sizeof(string), "[INFO]: Ovo vozilo je u vlasništvu %s.", vlasnik);
    SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
}


evo ti ovako ti ubaci svoja imena itd.. nadam se da ces skuzit
pa lako je kada si kopirao,otkud njemu "KupljenoVozilo" definirano ?

Lemi_Zero

aj pomozite kako to da definiram ?? pls  :)
Poslednja Izmena: Decembar 13, 2011, 17:53:21 POSLE PODNE od Lemi_Zero

evo ti ovo je samo primjer
i dodajes pod
enum ahCar
CarVlasnik
i tamo gdje ti se sacuva i tamo gdje ti se ucitava eto... primjera

OnPlayerEnterVehicle

if(GetPlayerVehicleID(playerid) == Carlist[i][Carid])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(strcmp(sendername, Carlist[i][Vlasnik], true) == 0) { }
else
{
ClearAnimations(playerid);
format(string, sizeof(string), "Vlasnik: %s", Carlist[i][CarVlasnik]);
SendClientMessage(playerid, -1, string);
}
}
Poslednja Izmena: Decembar 13, 2011, 18:02:08 POSLE PODNE od incluDe.

Lemi_Zero

Ubacio sam sve sto si rekao ali mi iskoce ovi errori....

Citat: Lemi_Zero poslato Decembar 13, 2011, 18:24:31 POSLE PODNE
Ubacio sam sve sto si rekao ali mi iskoce ovi errori....


new sendername[MAX_PLAYER_NAME]

Citat: Nxidza poslato Decembar 13, 2011, 17:51:05 POSLE PODNE
Citat: Narco_VK poslato Decembar 13, 2011, 15:31:13 POSLE PODNE
znaci pod ovaj callback OnPlayerStateChange

radis za to..

if(newstate == PLAYER_STATE_DRIVER)
{
    new veh = GetPlayerVehicleID(playerid);
if(KupljenoVozilo[veh] == 1)
{
    new vlasnik[24], string[128];
    GetPlayerName(VoziloID[veh], vlasnik, sizeof(vlasnik));
format(string, sizeof(string), "[INFO]: Ovo vozilo je u vlasništvu %s.", vlasnik);
    SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
}


evo ti ovako ti ubaci svoja imena itd.. nadam se da ces skuzit
pa lako je kada si kopirao,otkud njemu "KupljenoVozilo" definirano ?

to sam mu dao primjer.. :D
Vratio sam se ponovo ocekjute novi server...