Jump to content

Question

Posted

Salut Sa-Mp.Ro! Cum v-am mai spus sunt incepator in scripting si as dori sa stiu cum pot face sa se execute comanda /refresh odata la 1 minut pentru toti playerii?

Astept raspunsuri...(Dau +1 raspunsului ajutator).

Y!M: [email protected] ( help-center sau comenzi )

4 answers to this question

Recommended Posts

Posted

1. Faci un callback: public RefreshPlayers().

2. Te duci la OnGameModeInit() si adaugi un timer: SetTimer("RefreshPlayers", 60000, 1);

3. adaugi:

public RefreshPlayers()

{

For(new i = 0, i < GetMaxPlayers(), i++)

{

if(IsPlayerConnected(i))

{

Aici pui comanda refresh

}

}

}

i0418xcttya707ofg.jpg

Posted

Sau poti face cu timer + CallRemoteFunction(params):

Cum s-a zis si mai sus, la OnGameModeInit() pui:

[pawn]

  SetTimer("RefreshPlayers", 60000, 1);

[/pawn]

apoi adaugi: (in afara oricarui public)

[pawn]

  public RefreshPlayers() {

  for(new c = 0; c < MAX_PLAYERS; c++)

      if(IsPlayerConnected©)

            // poti pune si un if(IsPlayerLogged©) sau cum ai tu functia

            CallRemoteFunction("OnPlayerCommandText", "is", c, "/refresh");

  return 1;

  }

[/pawn]

Teoretic, ar trebui sa mearga si asa.

Posted

Va multumesc. Si Rock:

Comanda /refresh da refresh unui player atunci cand nu vede o chestie sau o cladire.. etc. Si vreau sa-i pun timer si nu stiu cum. Acum am inteles. :)

Y!M: [email protected] ( help-center sau comenzi )

Guest
This topic is now closed to further replies.
×
×
  • 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.