ANNOUNCE

Probleme | Intrebari | Nelamuriri - Pawno

609 posts in this topic

De ce iti declari functia GetPlayerVehicleID in mai multe variabile ?

 

Ceva de genu,ar merge?

 

 

case DIALOG_VEHICLE1: {
    new string[64],
    id = GetPlayerVehicleID(playerid);
    if(id) {
        SetVehicleToRespawn(id);
        format(string, sizeof(string), "Vehiculul cu ID-ul [%d] a fost respawnat.", vehicleid);
        SendClientMessage(playerid, -1, string);
    } else SendClientMessage(playerid, -1, "Trebuie sa te aflii in masina pentru a putea utiliza aceasta optiune !");
}

Share this post


Link to post
Share on other sites

Kurama, uite ce doreste el sa faca:

 

 

Eu insa nu vad restrictie in privinta asta in cod ..

Scuzele mele :) Acum am vazut acel „nu” in propoziție :))

 

Păi atunci scoate if(IsPlayerInVehicle(playerid, carid)) din comanda si aia e...

Share this post


Link to post
Share on other sites

Nu m am exprimat eu bine
Eu doar vreau sa fac sa iti poti respawna masina personala,fara sa trebuiasca sa fii in ea.

Comanda:

CMD:cars(playerid, params[])
{
    new playername[24];
    GetPlayerName(playerid, playername, sizeof(playername));
    new info[2048], bool:found;
    for(new i=MasiniDinGamemode; i < MAX_VEHICLES; i++)
    {
        if(VehicleCreated[i] == VEHICLE_PLAYER && strcmp(VehicleOwner[i], playername) == 0)
        {
            found = true;
            format(info, sizeof(info), "%s"#Culoare2"ID: "#Culoare1"%d "#Culoare2"Vehicul: "#Culoare1"%s "#Culoare2"["#Culoare1"%s"#Culoare2"]\n", info, i, VehiclesName[VehicleModel[i]-400], VehicleNumberPlate[i]);
        }
    }
    if(!found) return SendClientMessage(playerid, COLOR_RED, ""#Culoare1"NumeServer | "#Culoare2"Nu ai nici un vehicul .");
    ShowPlayerDialog(playerid, DIALOG_VEHICLE, DIALOG_STYLE_LIST, ""#Culoare1"Masinile Personale", info, "Select", "Renunta");
    return 1;
}

Dialog1

case DIALOG_VEHICLE:
{
        if(response)
        {
            ShowPlayerDialog(playerid, DIALOG_VEHICLE1, DIALOG_STYLE_LIST, "Optiuni", "Respawneaz-o\nLocalizeaz-o\nCumpara Asigurare(suma)\nReseteaza Kilometrajul(suma)", "Ok", "Cancel");
        }
    }

Dialog2

case DIALOG_VEHICLE1:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
{
                    new string[256],sendername[MAX_PLAYER_NAME];
new id = GetPlayerVehicleID(playerid);
                    new vehicleid = id;
                    SetVehicleToRespawn(vehicleid);
format(string, sizeof(string), "Vehiculul cu ID-ul [%s] a fost respawnat.", vehicleid);
GetPlayerName(playerid, sendername, sizeof(sendername));
     }
 
Edited by GNR

Share this post


Link to post
Share on other sites

Salut, GNR !

 

M-am uitat peste codul tau si ai unele probleme.

new id = GetPlayerVehicleID(playerid);
new vehicleid = id;

Stii ce inseamna particica asta de cod ? Definesti inutil a 2-a variabila (vehicleid) cand tu ai deja definit "id". Deci te poti folosi simplu de variabila id si sa stergi var vehicle.

 

Cealalta problema stricta de masina personala. Eu nu cunosc sistemul tau de masini personale, trebuie sa te uiti tu si sa cauti unde setezi masina proprietarului, trebuie facuta o variabila separata intre jucator si masina, sa fie aceeasi ca sa stii ce masina respawneaza. Tu acolo in cod cu functie "GetPlayerVehicleID" afli id-ul masinii in care se afla. Daca stergi partea aia de cod trebuie sa stii ce masina respawnezi, id-ul masinii cu pricina. In caz contrar, ramai doar la spawnarea masinii din vehicul.

Edited by CaRa

Share this post


Link to post
Share on other sites

 

De ce iti declari functia GetPlayerVehicleID in mai multe variabile ?

 

Ceva de genu,ar merge?

case DIALOG_VEHICLE1: {
    new string[64],
    id = GetPlayerVehicleID(playerid);
    if(id) {
        SetVehicleToRespawn(id);
        format(string, sizeof(string), "Vehiculul cu ID-ul [%d] a fost respawnat.", vehicleid);
        SendClientMessage(playerid, -1, string);
    } else SendClientMessage(playerid, -1, "Trebuie sa te aflii in masina pentru a putea utiliza aceasta optiune !");
}

Share this post


Link to post
Share on other sites

Ma poate ajuta cineva?

 

C:\Users\yanek\Desktop\UnixGamemode\gamemodes\rpgro.pwn(21641) : warning 213: tag mismatch
C:\Users\yanek\Desktop\UnixGamemode\gamemodes\rpgro.pwn(21648) : error 055: start of function body without function header
C:\Users\yanek\Desktop\UnixGamemode\gamemodes\rpgro.pwn(21649) : error 010: invalid function or declaration
C:\Users\yanek\Desktop\UnixGamemode\gamemodes\rpgro.pwn(21654) : error 010: invalid function or declaration

 

 

 

uitati si script-ul pe care am incercat sa il fac

 

CMD:vipwheels(playerid, params[])
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
    if(vehicleid == personalcar[0][playerid] || vehicleid == personalcar[1][playerid] || vehicleid == personalcar[2][playerid] || vehicleid == personalcar[3][playerid] || vehicleid == personalcar[4][playerid] || vehicleid == personalcar[5][playerid])
    {
        if(CarInfo[OwnedVeh(vehicleid)][cVIP] == 0) return SCM(playerid, -1, "Acesta nu este un vehicul VIP.");
        ShowPlayerDialog(playerid, DIALOG_VIPWH, DIALOG_STYLE_LIST, "VIP Wheels", "Gold Wheels\nDollar Wheels\nShadow Wheels", "Set", "Cancel");
    }
    return 1;
}

Share this post


Link to post
Share on other sites

Salutare eGaming am nevoie de un ajutor mic ,am un servar pe localhost sa a joc singur ,si nu stiu cum sa rezolv o  eroare ma ajutati va rog frumos ,eroarea este

C:\iulian\Server\gamemodes\GMarea.pwn(3383) : error 021: symbol already defined: "Streamer_OnPlayerConnect"

Aceasta este eroarea mea ,este un sv de pe aesta comunitate de la yooBogdan si am incercat sa bag comenzile /createevent,/removeevent ,/stoptpevent,/tpevent

Multumesc e gaming

Share this post


Link to post
Share on other sites
13 hours ago, Gabriel112 said:

Salut , am facut un sistem de radar PD , dar am niste erori intr o linie si nu stiu sa le rezolv ... 

As fii foarte recunoscator daca as gasii solutia..

Multumesc.

 

Aveti toate detaliile aici

https://pastebin.com/pZPH9Khf

Linile errorilor nu corespund cu linile codului

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.