Jump to content

[CERERE] Tutorial comanda [/update]


Exord

Recommended Posts

Salut , daca ar putea cineva sa ma ajute cum as putea face aceasta comanda as fi foarte recunoscator. Am tot  cautat pe youtube si pe alte forumuri si pur si simplu nu gasesc cum o pot face pe aceasta. Cine ma poate ajuta sa imi lase skypeul sau intr-un reply la acest topic. Multumesc frumos. O zi frumoasa in continuare !

Link to comment
Share on other sites

Salut ! uite un tutorial nu este chiar pentru comanda /tutorial cum iti doresti tu dar tot lafel se creeaza si comanda pe care tu o cauti:

Uite si un model cu comanda pe care tu o cauti:

EXEMPLUL:CMD:update(playerid, params[])
{
    SCM(playerid, 0xFFFF00AA, " Pune aici detaliile despre update )./");
    SCM(playerid, 0xFFFF00AA, " Pune aici detaliile despre uptate )./");    
    return 1;
}

Imi cer scuze daca nu la asta te refereai prin comanda /update dar eu am pus ce am inteles :)

Sper ca te-am ajutat!

 

Link to comment
Share on other sites

On 9/30/2017 at 1:57 PM, Mister said:

Ce doresti si faca aceasta Comanda?

Salut , as dorii ca aceasta comanda cand implementez un sistem nou sa apara acolo

Ex : Noul update 0.4 contine:

Adauga comanda x , y , z

Lucrat la mapping

Rezolvate diferse buguri minore , daca stii cumva cum pot face iti multumesc pt ajutor.

 

Link to comment
Share on other sites

1 hour ago, MegaZ775 said:

Salut ! uite un tutorial nu este chiar pentru comanda /tutorial cum iti doresti tu dar tot lafel se creeaza si comanda pe care tu o cauti:

Uite si un model cu comanda pe care tu o cauti:

EXEMPLUL:CMD:update(playerid, params[])
{
    SCM(playerid, 0xFFFF00AA, " Pune aici detaliile despre update )./");
    SCM(playerid, 0xFFFF00AA, " Pune aici detaliile despre uptate )./");    
    return 1;
}

Imi cer scuze daca nu la asta te refereai prin comanda /update dar eu am pus ce am inteles :)

Sper ca te-am ajutat!

 

Salut , am incercat sa pun in practica tutorialul tau dar am primit cateva erori , daca ma poti ajuta te pwp.

Link to comment
Share on other sites

Poftim 

Spoiler

CMD:updates(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_ERROR, "Nu esti loagat.");
    new query[1000],versiune[128],updateid,vizionari,text[40][1000],rezultat[1000],query2[256],textafisare[2000],data[128], updateid2 = 0;
    mysql_format(SQL, query, sizeof(query), "SELECT * FROM `updates` WHERE `ID` > '0'");
    new Cache: cache = mysql_query(SQL, query);
    if(cache_get_row_count() < 1) return SCM(playerid, COLOR_ERROR, "Nu exista updateuri adaugate in lista.");
    for(new i, j = cache_get_row_count(); i != j; i++)
    {
        updateid = cache_get_field_content_int(i, "ID");
        vizionari = cache_get_field_content_int(i, "Vizionari");
        cache_get_field_content(i, "Versiune", rezultat); format(versiune, 128, rezultat);
        cache_get_field_content(i, "Data", rezultat); format(data, 128, rezultat);
        for(new a = 0; a < 40; a++)
        {
            format(query2, sizeof(query2), "Text%d",a);
            cache_get_field_content(i, query2,rezultat); format(text[a], 1000, rezultat);
            strcpy(updatetext[a][updateid2], text[a], 1000);
        }
        strcpy(updatedata[updateid2], data, 128);
        strcpy(updateversiune[updateid2], versiune, 128);
        updateid2++;
        if(updateid == 1) format(textafisare, sizeof(textafisare), "{0066FF}ID\t{FFFFFF}Versiune\t{0066FF}Data\t{FFFFFF}Vizionari\n{FFFFFF}Update {0066FF}# %d\t{FFFFFF}%s\t{0066FF}%s{FFFFFF}\t%d",updateid, versiune,data, vizionari);
        if(updateid > 1) format(textafisare, sizeof(textafisare), "%s\n{FFFFFF}Update {0066FF}# %d\t{FFFFFF}%s\t{0066FF}%s{FFFFFF}\t%d",textafisare,updateid,versiune,data, vizionari);
    }
    ShowPlayerDialog(playerid, DIALOG_UPDATES, DIALOG_STYLE_TABLIST_HEADERS, "SERVER: Updates", textafisare, "Seleteaza","Anuleaza");
    cache_delete(cache);
    return 1;
}
CMD:au(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_ERROR, "Nu esti loagat.");
    if(PlayerInfo[playerid][pAdmin] >= 7 && EstiFondator(playerid))
    {
        new versiune[128],data[128],query[1000];
        if(sscanf(params, "s[128]", versiune)) return SCM(playerid, -1, "USAGE: /addupdate [nume versiune]");
        new year, month,day;
        getdate(year, month, day);
        format(data, sizeof(data), "%02d.%02d.%d",day,month,year);
        mysql_format(SQL, query, sizeof(query), "INSERT INTO `updates` (`Versiune`,`Data`) VALUES ('%s','%s')",versiune,data);
        mysql_tquery(SQL, query, "", "");
        SCM(playerid, -1, "{0066FF}UPDATE: {FFFFFF}Versiunea a fos adaugata cu succes.");
    }
    return 1;
}

 

Link to comment
Share on other sites

22 hours ago, Uzzi25 Official said:

Poftim 

  Hide contents

CMD:updates(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_ERROR, "Nu esti loagat.");
    new query[1000],versiune[128],updateid,vizionari,text[40][1000],rezultat[1000],query2[256],textafisare[2000],data[128], updateid2 = 0;
    mysql_format(SQL, query, sizeof(query), "SELECT * FROM `updates` WHERE `ID` > '0'");
    new Cache: cache = mysql_query(SQL, query);
    if(cache_get_row_count() < 1) return SCM(playerid, COLOR_ERROR, "Nu exista updateuri adaugate in lista.");
    for(new i, j = cache_get_row_count(); i != j; i++)
    {
        updateid = cache_get_field_content_int(i, "ID");
        vizionari = cache_get_field_content_int(i, "Vizionari");
        cache_get_field_content(i, "Versiune", rezultat); format(versiune, 128, rezultat);
        cache_get_field_content(i, "Data", rezultat); format(data, 128, rezultat);
        for(new a = 0; a < 40; a++)
        {
            format(query2, sizeof(query2), "Text%d",a);
            cache_get_field_content(i, query2,rezultat); format(text[a], 1000, rezultat);
            strcpy(updatetext[a][updateid2], text[a], 1000);
        }
        strcpy(updatedata[updateid2], data, 128);
        strcpy(updateversiune[updateid2], versiune, 128);
        updateid2++;
        if(updateid == 1) format(textafisare, sizeof(textafisare), "{0066FF}ID\t{FFFFFF}Versiune\t{0066FF}Data\t{FFFFFF}Vizionari\n{FFFFFF}Update {0066FF}# %d\t{FFFFFF}%s\t{0066FF}%s{FFFFFF}\t%d",updateid, versiune,data, vizionari);
        if(updateid > 1) format(textafisare, sizeof(textafisare), "%s\n{FFFFFF}Update {0066FF}# %d\t{FFFFFF}%s\t{0066FF}%s{FFFFFF}\t%d",textafisare,updateid,versiune,data, vizionari);
    }
    ShowPlayerDialog(playerid, DIALOG_UPDATES, DIALOG_STYLE_TABLIST_HEADERS, "SERVER: Updates", textafisare, "Seleteaza","Anuleaza");
    cache_delete(cache);
    return 1;
}
CMD:au(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_ERROR, "Nu esti loagat.");
    if(PlayerInfo[playerid][pAdmin] >= 7 && EstiFondator(playerid))
    {
        new versiune[128],data[128],query[1000];
        if(sscanf(params, "s[128]", versiune)) return SCM(playerid, -1, "USAGE: /addupdate [nume versiune]");
        new year, month,day;
        getdate(year, month, day);
        format(data, sizeof(data), "%02d.%02d.%d",day,month,year);
        mysql_format(SQL, query, sizeof(query), "INSERT INTO `updates` (`Versiune`,`Data`) VALUES ('%s','%s')",versiune,data);
        mysql_tquery(SQL, query, "", "");
        SCM(playerid, -1, "{0066FF}UPDATE: {FFFFFF}Versiunea a fos adaugata cu succes.");
    }
    return 1;
}

 

C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 017: undefined symbol "updatetext"
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Ai idee de ce primesc aceasta eroare ? Sunt mai incepator la scripting si nu ma descurc chiar atat de bine...

Link to comment
Share on other sites

4 hours ago, Exord said:

C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 017: undefined symbol "updatetext"
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(41555) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Ai idee de ce primesc aceasta eroare ? Sunt mai incepator la scripting si nu ma descurc chiar atat de bine...

Adauga #define updatetext

Link to comment
Share on other sites

On 10/3/2017 at 12:04 AM, Uzzi25 Official said:

Adauga #define updatetext

C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(20458) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(20458) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(20458) : error 029: invalid expression, assumed zero
C:\Users\viperex\Desktop\Crashed Romania\BigZoneGM\gamemodes\BigZoneGM.pwn(20458) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


?

Link to comment
Share on other sites

Salut poti incerca asa:

#define MAX_UPDATE_LENGTH 1500
#define UPDATE_DIALOG 5879
#define UPDATE_DIALOG_NAME "Server Updates"
#define ShowUpdateDialog(%0,%1) ShowPlayerDialog(%0, UPDATE_DIALOG, 0, UPDATE_DIALOG_NAME, %1, "Close", "")

CMD:updates(playerid, params) {
	new updateString[MAX_UPDATE_LENGTH]; // Big large string
	if(strlen(updateString) > MAX_UPDATE_LENGTH) return 0;
	format(updateString, sizeof(updateString), "Text Update");
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	ShowUpdateDialog(playerid, updateString);
	return 1;
}

 

Edited by BuNiCu-RP
  • Thanks 1
Link to comment
Share on other sites

On 10/9/2017 at 8:50 PM, BuNiCu-RP said:

Salut poti incerca asa:


#define MAX_UPDATE_LENGTH 1500
#define UPDATE_DIALOG 5879
#define UPDATE_DIALOG_NAME "Server Updates"
#define ShowUpdateDialog(%0,%1) ShowPlayerDialog(%0, UPDATE_DIALOG, 0, UPDATE_DIALOG_NAME, %1, "Close", "")

CMD:updates(playerid, params) {
	new updateString[MAX_UPDATE_LENGTH]; // Big large string
	if(strlen(updateString) > MAX_UPDATE_LENGTH) return 0;
	format(updateString, sizeof(updateString), "Text Update");
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	format(updateString, sizeof(updateString), "%s\nText Update", updateString);
	ShowUpdateDialog(playerid, updateString);
	return 1;
}

 

Multumesc frumos , chiar m-ai ajutat <3.

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.