Jump to content

[Tutorial] Sistema de apreciere server


khain.dev

Recommended Posts

Buna,astazi va prezint un sistem de apreciere unde jucatorul cind introduce comanda ("/apreciere")  poate aprecia serverul,aceste aprecier sunt salvate Mixini deoarece nu vad nici un rost ca sa il fac MySQL,sa incepem!

Citat

//variabile

new ap;
new bool:Playerap[MAX_PLAYERS];

//ongamemodeinit

if(fexist("logap.txt"))
{
   
new string[32];
   
new File:hFile = fopen("logap.txt", io_read);
    fread(hFile, string);
    ap = strval(string);
    fclose(hFile);
}


//ongamemodeexit

if(fexist("logap.txt"))
{
   
new string[32];
   
new File:hFile = fopen("logap.txt", io_write);
    format(string, sizeof(string), "%d", ap);
    fwrite(hFile, string);
    fclose(hFile);
}

//onplayerconnect

Playerap[playerid] = false;

//ondialogresponse

if(dialogid == 1 && response)
{
    new string[256];
    ap = (Playerap[0]) ? (ap-1) : (ap+1); 
    if(!Playerap[playerid]) format(string, sizeof(string), "\n\n{FFFAFA}Acest server a fost apreciat de{FFD700} %d {FFFFFF}jucatori.\n{FFFAFA}Aprecierea dvs. a fost adaugata\n\n", ap);
    else format(string, sizeof(string), "\n\n{FFFAFA}Acest server a fost apreciat de{FFD700} %d {FFFFFF}jucatori.\n{FFFAFA}Aprecierea dvs. a fost eliminate\n\n", ap);        
    ShowPlayerDialog(playerid, 1, 0, " ", string, "Apreciere", "Inchide");
    Playerap[playerid] = !Playerap[playerid];
}

//onplayercommandtext

CMD:apreciere(playerid, params[])
{
    new string[256];
    format(string, sizeof(string), "\n\n{FFFAFA}Acest server a fost apreciat de{FFD700} %d {FFFFFF}jucatori.", ap);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, " ", string, "Apreciere", "Inchide"); // Если диалог 1 есть то делаем свои цифры.
}

 

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

  • 2 weeks later...
  • 8 months later...

Superb, fiecare își poate arata aprecierea pe server, ar fi fain sa poti lasa si o notificare privind votul, parerea jucătorilor. In timpul asta sa fie legat si de forum cu o categorie aparte, fiind expuse tuturor.

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

Link to comment
Share on other sites

  • 4 months later...

Chiar nu imi dau seama ce utilitate ar putea avea acest sistem... daca era un sistem care accepta sugestii legate de server era mult mai folositor, dar asa, chiar nu vad niciun folos...

Facebook

YouTube

Discord: peiN#5187

Ofer servicii scripting de cea mai buna calitate. Ma puteti contacta prin PM / Facebook / Discord.

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.

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