Jump to content

Apelarea func?iilor locale si globale.


eXorcism

Recommended Posts

Salut tuturor ast?zi v? voi ar?ta cum se folosesc dou? func?ii care ajuta la apelarea altor func?ii/comenzi.

Func?iile despre care voi vorbi ast?zi se numesc CallLocalFunction si CallRemoteFunction

S? Începem

CallLocalFunction

Este o func?ie ce apeleaza alte func?ii doar local( În scriptul în care este folosit? ).

Parametrii:

CallLocalFunction(const function[], const format[], {Float,_}:...)

function[ ] Este numele functiei(publicului).

format[ ] Aici punem parametri folosi?i.

{Float,_}:... Aici definim parametrii.

Parametrii pentru formatare:

[pawn]

c  Un caracter

d, i Integer , zecimele

x Cod Hex

f Float

s  String

[/pawn]

Exemplu:

[pawn]

public OnPlayerConnect( playerid )

{

    CallLocalFunction( "Say" , "ds" , playerid , "Bine ai venit pe serverul meu." );

    /* "Say" - Numele plublicului

          "ds" - Parametri. d - decimal , s - string, respectiv playerid ?i "Bine ai venit pe serverul meu." .

    */

    return ( 1 );

}

forward Say( playerid , const message [ ] );

public Say( playerid , const message [ ] )

    return SendClientMessage( playerid , -1 , message );

[/pawn]

CallRemoteFunction

Este o func?ie ce apeleaza alte func?ii Local( În scriptul în care este folosit? )/Global( În orice script ).

Parametrii:

CallRemoteFunction(const function[], const format[], {Float,_}:...)

function[ ] Este numele functiei(publicului).

format[ ] Aici punem parametri folosi?i.

{Float,_}:... Aici definim parametrii.

Parametrii pentru formatare:

[pawn]

c  Un caracter

d, i Integer , zecimele

x Cod Hex

f Float

s  String

[/pawn]

Exemplu:

[pawn]

public OnPlayerConnect( playerid )// este in gamemode

{

    CallRemoteFunction( "Say" , "ds" , playerid , "Bine ai venit pe serverul meu." );

    /* "Say" - Numele plublicului

          "ds" - Parametri. d - decimal , s - string, respectiv playerid ?i "Bine ai venit pe serverul meu." .

    */

    return ( 1 );

}

forward Say( playerid , const message [ ] );// este intr-un filterscript( Loadat )

public Say( playerid , const message [ ] )

    return SendClientMessage( playerid , -1 , message );

[/pawn]

I'm back bitches.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.