Jump to content
  • 0

Cerere tutorial comanda /players


Question

5 answers to this question

Recommended Posts

  • 0

Fa asa daca folosesti foreach:

new string[600];
foreach(new i: Player)
{
    format(string, sizeof(string), "%s - %d\n", GetName(playerid), Score);
}
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Server players", string, "Ok", "" );

Inlocuieste dialognoresponse cu un dialog pe care il ai care nu raspunde(nu afiseaza) cu nimic cand apesi pe OK. In loc de Score pui variabila prin care iei scorul jucatorului/levelul.

Daca nu ai foreach:

new string[600];
for(new i, j = GetMaxPlayers(); i < j; i++)
{
    if(!IsPlayerConnected(playerid)) continue;
    format(string, sizeof(string), "%s - %d\n", GetName(playerid), Score);
}
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Server players", string, "Ok", "" );
Edited by BaFFyJunior
Link to post
Share on other sites
  • 0
On 4/30/2020 at 1:30 AM, BaFFyJunior said:

Fa asa daca folosesti foreach:

new string[600];
foreach(new i: Player)
{
    format(string, sizeof(string), "%s - %d\n", GetName(playerid), Score);
}
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Server players", string, "Ok", "" );

Inlocuieste dialognoresponse cu un dialog pe care il ai care nu raspunde(nu afiseaza) cu nimic cand apesi pe OK. In loc de Score pui variabila prin care iei scorul jucatorului/levelul.

Daca nu ai foreach:

new string[600];
for(new i, j = GetMaxPlayers(); i < j; i++)
{
    if(!IsPlayerConnected(playerid)) continue;
    format(string, sizeof(string), "%s - %d\n", GetName(playerid), Score);
}
ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Server players", string, "Ok", "" );

si ce comanda pun ca sa arate chestia asta

Link to post
Share on other sites
  • 0
Acum 14 ore, [VanREAL] a spus:

si ce comanda pun ca sa arate chestia asta

Pai asta e comanda...

CMD:players(playerid, params[])
{
    new string[600]; 
    foreach(new i: Player) { 
       format(string, sizeof(string), "%s - %d\n", GetName(playerid), Score); 
    } 
    ShowPlayerDialog(playerid, DialogNoResponse, DIALOG_STYLE_LIST, "Server players", string, "Ok", "" );
    return 1;
}

 

Link to post
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
Answer this question...

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