Jump to content

[4]Cum sa faci o comanda Complexa


Gireada

Recommended Posts

Daca in tutorialul 3 vam aratat cum sa faci o comanda simpla pe ZCMD. In acest tutorial va voi arata cum sa faci o comanda complexa cu ajutorul lui SSCANF.

Ca in tutorialul trecut aveti nevoie de un includer(ZCMD) si de un plugin(SSCANF. Vom pune la inceputul scriptului #include <zcmd> si #include <sscanf2>

Sa incepem tutorialul

Din comanda simpla(/tutorial) vom face una complexa. Vom afisa unui jucator mesajul tutorial.

CMD:tutorial(playerid, params[])
{
    new giveplayerid;
    if(unformat(params, "u", giveplayerid))  return SendClientMessage(playerid, -1, "Foloseste: /tutorial [playerid]");
    SendClientMessage(giveplayerid, -1, "Tutorial");
    return 1;
}

In functia unformat a aparut acest params de care v-am zis in tutorialul trecut ca este folosit de SSCANF. Cred ca va intrebati ce este acest u. El face parte din parametrii care s-au adaugat cu ajutor de la SSCANF. u vine de la idjucator/numejucator. Mai jos veti gasi un tabel cu toti parametrii si cu ce fac ei(ce parametrii adauga).

[table]

Parametrii Nume Exemple de valori

b Binary 01001, 0b1100

c Caracter a, o, *

f Float 0.7, -99.5

g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E

h, x Hex 1A, 0x23

i, d Intreg 1, 42, -10

l Logical true, false

n Numar 42, 0b010, 0xAC, 045

o Octal 045 12

q Nume bot/id bot ShopBot, 27

r Nume jucator/id jucator Y_Less, 42

u Nume jucator/id jucator(boti si jucator) Y_Less, 0[/table]

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...

Join the conversation

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

Guest
Reply to this topic...

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