Ovaj callback se poziva kada igrac unese na chat neku komandu na primer: /pomoc


(playerid, cmdtext[])
playerid - ID igraca koji koristi komandu
cmdtext[] - Pozivanje komande
0 - ako komanda nije uspesna, 1 - ako jeste.

Primer Edit

public OnPlayerCommandText(playerid, cmdtext[])
    if(!strcmp(cmdtext, "/pomoc", true))
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Ovo je /pomoc komanda!");
        return 1;
        // Return 1, dakle komanda izvrsena uspesno
        // OnPlayerCommandText se nece dalje pozivati
    return 0;
    // Returning 0 znaci da komanda nije uspesna
    // OnPlayerCommandText ce se koristi u skripti iz return 1

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.