Jump to content
  • 0

Problema Error Argument 1


VAurel

Question

Salut, am incercat sa modific functia de VipNameVehicle din gamemode-ul meu si primesc o erroare despre care nu imi dau seama cum sa o rezolv, daca aveti vreo idee, orice parere este acceptata si bine primita :) 

Cod

function VIPNameVehicle(vehicleid)
{
    new arrayid = OwnedVeh(vehicleid); veh_ArrayID(vehicleid);
    if(strlen(CarInfo[arrayid][cVipname]) > 3 && CarInfo[arrayid][cVipShow] == 1)
    {
        new string[100];
        if(IsValidDynamicObject(vText[vehicleid])) DestroyDynamicObject(vText[vehicleid]);

        vText[vehicleid] = CreateDynamicObject(19327, CarInfo[arrayid][cVX],CarInfo[arrayid][cVY],CarInfo[arrayid][cVZ],CarInfo[arrayid][cVRX],CarInfo[arrayid][cVRY],CarInfo[arrayid][cVRZ],-1,-1,-1,30,30);

        format(string, 100, "{%s}%s", CarInfo[arrayid][cVipnamecolor], CarInfo[arrayid][cVipname]);
        SetDynamicObjectMaterialText(vText[vehicleid], 0, string, 50, "Arial", CarInfo[arrayid][cVipSize], 1, 0xFFFFFFFF, 0, 1);

        new model = CarInfo[arrayid][cModel];
        if(model == 411)
        {
            AttachDynamicObjectToVehicle(vText, vehicleid, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0); // 1585
        } 
        else if(model == 560)
        {
            AttachDynamicObjectToVehicle(vText, vehicleid, 0.0, 0.0, 0.8, 0.0, 0.0, 0.0); // 1589
        }
        else if(model == 541)
        {
            AttachDynamicObjectToVehicle(vText, vehicleid, 0.0, -0.2, 0.62, 0.0, 0.0, 0.0); //1593
        }
        else if(model == 562)
        {
            AttachDynamicObjectToVehicle(vText, vehicleid,  0.0, -0.4, 0.75, 0.0, 0.0, 0.0); // 1597
        }
        else if(model == 451)
        {
            AttachDynamicObjectToVehicle(vText, vehicleid, 0.0, -0.5, 0.55, 0.0, 0.0, 0.0); // 1601
        }
    }
    return 1;
}   

Errori

gamemode.pwn(1585) : error 035: argument type mismatch (argument 1)
gamemode.pwn(1589) : error 035: argument type mismatch (argument 1)
gamemode.pwn(1593) : error 035: argument type mismatch (argument 1)
gamemode.pwn(1597) : error 035: argument type mismatch (argument 1)
gamemode.pwn(1601) : error 035: argument type mismatch (argument 1)

Randurile cu errorile le-am trecut in cod, multumesc anticipat.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Salut @VAurel,

Tu ai creat variabila vText, care sa corespunda unui vehicul anume (exemplu: vText[vehicleid]). In liniile in care iti afiseaza erorile, nu ai trecut id-ul vehiculului pentru care ai creat acel obiect (vText), pe care vrei sa l atasezi.

Corect ar fi in felul urmator:

AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.5, 0.55, 0.0, 0.0, 0.0); // 1601

Daca nu ai inteles, verifica pe rand ce am adaugat eu in plus mai sus, cu o linie din codul tau, de unde porneste eroarea.

Ti-am explicat cat mai simplu zic eu. 

Bafta.

  • Thanks 1

Daca te-am ajutat =>

spacer.png

Link to comment
Share on other sites

  • 0
function VIPNameVehicle(vehicleid)
{
    new arrayid = OwnedVeh(vehicleid); veh_ArrayID(vehicleid);
    if(strlen(CarInfo[arrayid][cVipname]) > 3 && CarInfo[arrayid][cVipShow] == 1)
    {
        new string[100];
        if(IsValidDynamicObject(vText[vehicleid])) DestroyDynamicObject(vText[vehicleid]);

        vText[vehicleid] = CreateDynamicObject(19327, CarInfo[arrayid][cVX],CarInfo[arrayid][cVY],CarInfo[arrayid][cVZ],CarInfo[arrayid][cVRX],CarInfo[arrayid][cVRY],CarInfo[arrayid][cVRZ],-1,-1,-1,30,30);

        format(string, 100, "{%s}%s", CarInfo[arrayid][cVipnamecolor], CarInfo[arrayid][cVipname]);
        SetDynamicObjectMaterialText(vText[vehicleid], 0, string, 50, "Arial", CarInfo[arrayid][cVipSize], 1, 0xFFFFFFFF, 0, 1);

        new model = CarInfo[arrayid][cModel];
        if(model == 411)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0); // 1585
        } 
        else if(model == 560)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, 0.0, 0.8, 0.0, 0.0, 0.0); // 1589
        }
        else if(model == 541)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.2, 0.62, 0.0, 0.0, 0.0); //1593
        }
        else if(model == 562)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid,  0.0, -0.4, 0.75, 0.0, 0.0, 0.0); // 1597
        }
        else if(model == 451)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.5, 0.55, 0.0, 0.0, 0.0); // 1601
        }
    }
    return 1;
}   

 

Edited by hanako
  • Thanks 1
Link to comment
Share on other sites

  • 0
On 7/11/2021 at 9:25 PM, shane said:

Salut @VAurel,

Tu ai creat variabila vText, care sa corespunda unui vehicul anume (exemplu: vText[vehicleid]). In liniile in care iti afiseaza erorile, nu ai trecut id-ul vehiculului pentru care ai creat acel obiect (vText), pe care vrei sa l atasezi.

Corect ar fi in felul urmator:

AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.5, 0.55, 0.0, 0.0, 0.0); // 1601

Daca nu ai inteles, verifica pe rand ce am adaugat eu in plus mai sus, cu o linie din codul tau, de unde porneste eroarea.

Ti-am explicat cat mai simplu zic eu. 

Bafta.

Am inteles perfect din prima, si deja de cand mi-ai scris primul rand mi-am dat seama de ce ai zis :))) Mersi mult ❤️ 

On 7/11/2021 at 10:00 PM, hanako said:
function VIPNameVehicle(vehicleid)
{
    new arrayid = OwnedVeh(vehicleid); veh_ArrayID(vehicleid);
    if(strlen(CarInfo[arrayid][cVipname]) > 3 && CarInfo[arrayid][cVipShow] == 1)
    {
        new string[100];
        if(IsValidDynamicObject(vText[vehicleid])) DestroyDynamicObject(vText[vehicleid]);

        vText[vehicleid] = CreateDynamicObject(19327, CarInfo[arrayid][cVX],CarInfo[arrayid][cVY],CarInfo[arrayid][cVZ],CarInfo[arrayid][cVRX],CarInfo[arrayid][cVRY],CarInfo[arrayid][cVRZ],-1,-1,-1,30,30);

        format(string, 100, "{%s}%s", CarInfo[arrayid][cVipnamecolor], CarInfo[arrayid][cVipname]);
        SetDynamicObjectMaterialText(vText[vehicleid], 0, string, 50, "Arial", CarInfo[arrayid][cVipSize], 1, 0xFFFFFFFF, 0, 1);

        new model = CarInfo[arrayid][cModel];
        if(model == 411)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0); // 1585
        } 
        else if(model == 560)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, 0.0, 0.8, 0.0, 0.0, 0.0); // 1589
        }
        else if(model == 541)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.2, 0.62, 0.0, 0.0, 0.0); //1593
        }
        else if(model == 562)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid,  0.0, -0.4, 0.75, 0.0, 0.0, 0.0); // 1597
        }
        else if(model == 451)
        {
            AttachDynamicObjectToVehicle(vText[vehicleid], vehicleid, 0.0, -0.5, 0.55, 0.0, 0.0, 0.0); // 1601
        }
    }
    return 1;
}   

 

Multumesc frate, eu am cerut doar o mica rezolvare nu un cod intreg, apreciez ❤️ 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.