Jump to content
  • 0

Question

Posted

Salut! Sunt unul dintre noii pawneri si, as avea nevoie de ajutor. Primesc eroarea :

error 025: function heading differs from prototype

Scriptul este acesta:

La OnPlayerCommandText sau cv genul. Any ideas?

scorpion.pwn

1 answer to this question

Recommended Posts

  • 0
Posted
Acum 11 ore, hjdas12 a spus:

Salut! Sunt unul dintre noii pawneri si, as avea nevoie de ajutor. Primesc eroarea :

error 025: function heading differs from prototype

Scriptul este acesta:

La OnPlayerCommandText sau cv genul. Any ideas?

scorpion.pwn 4 kB · 3 descărcări

Hai sa iti explic.

Tu folosesti include-ul zcmd acesta face serverul sa functioneze mai rapid si totodata schimba si modul de a creea o comanda

Odata folosit acest include nu mai poti face comenzi cum le faceai inainte cu if(strcmp, "/blabla") etc acuma te duci undeva in gamemode

si pentru a creea o comanda folosesti cmd:comanda(playerid, params[]) 

Un mic exemplu

Citat

CMD:healme(playerid, params[]) {
    SetPlayerHealth(playerid, 100);
    SCM(playerid, -1, "Ai primit 100Hp!");
    return 1;
}

Deci asa se face o comanda prin procesorul de comenzi zcmd

Acuma eroarea ta o primesti deoarece zcmd foloseste un alt mod pentru a verifica daca comanda exista sau nu pe server si poti schimba mesajul pe care il primeste

din Server: Unknown Command in orice vrei tu

Si inlocuiesti din 

Citat

public OnPlayerCommandText(params[], playerid, cmdtext[])
{
    if (strcmp("/carcolor", cmdtext, true, 10) == 0)
    {
        new ID,ID2;
        if(sscanf(params, "dd", ID,ID2)) return SendClientMessage(playerid, -1, "Folosire: /carcolor [color1] [color2]");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Nu te afli intr-un vehicul.");
        return 1;
    }
    return 0;
}

in

Citat

public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
    if(!success) SCM(playerid, -1, "mesaj");
    return 1;
}

Si daca tot ai comanda /carcolor de ce sa nu ti-o completez eu in zcmd sa vezi cum functioneaza

Citat

CMD:carcolor(playerid, params[]) {
    if(!IsPlayerInAnyVehicle(playerid))return SCM(playerid, -1, "Nu te aflii intr-un vehicul!");
    new c1, c2, string[64];
    if(sscanf(params, "ii", c1, c2))return SCM(playerid, -1, "Sintaxa: /carcolor <color1> <color2>");
    if(c1 < 0 || c1 > 255)return SCM(playerid, -1, "Invalid color1 (0-255)");
    if(c2 < 0 || c2 > 255)return SCM(playerid, -1, "Invalid color2 (0-255)");
    ChangeVehicleColor(GetPlayerVehicleID(playerid), c1, c2);
    format(string, sizeof(string), "Ai schimbat culorile vehiculului in %d si %d.", c1, c2);
    SCM(playerid, -1,string);
    return 1;
}

Daca te-am ajutat dai un +1 ms

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
×
×
  • 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.