Jump to content

[Tutorial] /Stats folosind dialog


Cosma Claudiu
 Share

Recommended Posts

 Salutare tuturor scripterilor, astazi o sa va arat cum se face o comanda /stats folosind un dialog :

 Rezultatul : http://i61.tinypic.com/fcsle9.png

 

 Sa incepem cu inceputul :

 

 Pasul 1 :

 

 Vom scrie la inceput :

 #include <a_samp> (esential)

 #include <zcmd> (ca sa putem face o comanda folosind CMD:...)

 

 

 Pasul 2 :

 

 Ne gandim ce sa apara cand tastam /stats.

 Eu ma gandesc sa arate daca ai Admin, Helper, Premium si cate Puncte premium ai, deci vom defini "Admin", "Helper", "Premium" si "PremiumPoints" folosind sistemul vostru de save/load.

 

 

 Pasul 3 :

 

 Vom incepe sa facem comanda :

 CMD:stats(playerid)

 {

 new Admin = PlayerInfo[playerid][pAdmin]; (Exact ce am spus mai sus la Pasul 2, vom defini Admin, Heleper, etc... folosind ceea ce avem in save/load daca aveti, daca nu, nu puteti face ceea ce vreau eu sa fac)

 new Helper = PlayerInfo[playerid][pHelper];
 new Premium = PlayerInfo[playerid][pPremium];
 new PremiumPoints = PlayerInfo[playerid][pPremiumPoints];

 

 (Vom folosi 1 pentru adevarat si 0 pentru fals)

 

 new String[250]; (Uitati-va pe wiki daca nu stiti ce cauta String-ul pe aici)

 new String2[250];

 new String3[250];

 new String4[250];

 

 if(Admin == 1)
 {
          format(String2,(sizeof(String2)), "{FFFFFF}Yes");
 }

 else

 {

          format(String2,(sizeof(String2)), "{FFFFFF}No");

 }

 if(Helper == 1)
 {
          format(String2,(sizeof(String2)), "{FFFFFF}Yes");

 }

 else

 {

          format(String2,(sizeof(String2)), "{FFFFFF}No");

 }

 if(Premium == 1)
 {
          format(String2,(sizeof(String2)), "{FFFFFF}Yes");

 }

 else

 {

          format(String2,(sizeof(String2)), "{FFFFFF}No");

 }

 format(String,(sizeof(String)), "{00FF00}Admin : %s\n{00FF00}Helper : %s\n{00FF00}Premium : %s\n{00FF00}Premium Points :  {FFFFFF}%d", String2, String3, String4, PremiumPoints); (sursa wiki : format)

 ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{00FF00}Statistics : ", String, "OK", "Cancel"); (sursa wiki :  DIALOG)
 return 1;

 }

 

 

 Pasul 4 :

 

 

 Testam comanda!

 

 

 

 Pasul 5 :

 

 

 Ne spunem parerea despre munca lui Efreed!

 

 

 Pasul 6 :

 

 

 Verificam daca chiar este munca lui Efreed : http://i.minus.com/iBDPQ2LHxABn6.bmp

 

 

Edited by Efreed
  • Upvote 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks 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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.