Jump to content
  • 0

Ajutor /Friends pe Tasta "Y"


PinDer

Question

Descrierea problemei:Salut,vreau si eu sa imi adaug pe serverul meu ca in loc sa tastez comanda /friends sa tastez tasta Y si sa imi afiseze lista playerilor..defapt sa fie ambele comenzi..sa fie la alegere cine doreste tasteaza /friends cine nu tasteaza Y
Liniile de cod / sursa / script-ul(obligatoriu): http://imgur.com/a/vcdhG
Imagini / Video (optional): http://imgur.com/a/vcdhG
Alte detalii:Va Rog Ajutatima!!!

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

sa adaugi comanda pe tasta Y este foarte simplu, urmeaza exemplul meu:

1. In primu rannd te duci la OnPlayerKeyStateChange.

2. In al doilea rand adaugi

if(newkeys == KEY_YES) // verifica daca este apasata tasta Y (in acest caz)

{

 // aici adaugi ce ai tu la comanda /friends

}

daca nu te descurci , lasa-mi mesaj sa til fac eu in pastebin , doar sa lasi aici un link pastebin cu comanda respectiva

Daca te-am ajuatat , +1 , nu strica

Cu respect, WARfree

Edited by WARfree
560x95_FFFFFF_FF9900_000000_000000.png
Link to comment
Share on other sites

  • 0
48 minutes ago, WARfree said:

sa adaugi comanda pe tasta Y este foarte simplu, urmeaza exemplul meu:

1. In primu rannd te duci la OnPlayerKeyStateChange.

2. In al doilea rand adaugi

if(newkeys == KEY_YES) // verifica daca este apasata tasta Y (in acest caz)

{

 // aici adaugi ce ai tu la comanda /friends

}

daca nu te descurci , lasa-mi mesaj sa til fac eu in pastebin , doar sa lasi aici un link pastebin cu comanda respectiva

Daca te-am ajuatat , +1 , nu strica

Cu respect, WARfree

Corect este:

If(newkeys & KEY_YES)

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
2 hours ago, WARfree said:

sa adaugi comanda pe tasta Y este foarte simplu, urmeaza exemplul meu:

1. In primu rannd te duci la OnPlayerKeyStateChange.

2. In al doilea rand adaugi

if(newkeys == KEY_YES) // verifica daca este apasata tasta Y (in acest caz)

{

 // aici adaugi ce ai tu la comanda /friends

}

daca nu te descurci , lasa-mi mesaj sa til fac eu in pastebin , doar sa lasi aici un link pastebin cu comanda respectiva

Daca te-am ajuatat , +1 , nu strica

Cu respect, WARfree

Nu mam descurcar,ajutama te rog

Link to comment
Share on other sites

  • 0
1 hour ago, PinDer said:

http://pastebin.com/UEvBv1AP

am lasat comanda friends

If(newkeys & KEY_YES)

{

if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new online[1000],offline[1000],query[300],result[30],name[30],idd,mid=1,aim2[2000];
        format(query, sizeof(query), "SELECT * FROM `friends` WHERE `PlayerID` = '%d' AND `Status`='1'",PlayerInfo[playerid][pSQLID]);
        new Cache: membresult = mysql_query(SQL,query);
        for(new i, j = cache_get_row_count (); i != j; ++i)
        {
            idd = cache_get_field_content_int(i, "FriendID");
            cache_get_field_content(i, "FriendName", result); format(name, 30, result);
            Selected[playerid][mid] = idd;
            format(online, sizeof(online), "%s{228404}[online]{FFFFFF} %s\n",online,name);
            mid++;
        }
        cache_delete(membresult);
        format(query, sizeof(query), "SELECT * FROM `friends` WHERE `PlayerID` = '%d' AND `Status`='0'",PlayerInfo[playerid][pSQLID]);
        new Cache: membresult1 = mysql_query(SQL,query);
        for(new i, j = cache_get_row_count (); i != j; ++i)
        {
            idd = cache_get_field_content_int(i, "FriendID");
            cache_get_field_content(i, "FriendName", result); format(name, 30, result);
            Selected[playerid][mid] = idd;
            format(offline, sizeof(offline), "%s{BB172D}[offline]{FFFFFF} %s\n",offline,name);
            mid++;
        }
        cache_delete(membresult1);
        format(aim2,sizeof(aim2),"{F89B0E}[+] Add Friend\n%s%s",online, offline);
        ShowPlayerDialog(playerid, DIALOG_FRIENDS, DIALOG_STYLE_LIST, "Friends", aim2, "Select", "Exit");
    }

}

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0
1 hour ago, PinDer said:

Primesc aceasta eroare de la PC

http://imgur.com/a/L5ax5

Verifica acoladele să nu fie mai multe sau mai puține 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0

asta e codul corect fara erori , dar vezi ca daca este sistemul de pe bigzone edit o sa poti adauga conturi inexistente si iti creaza bug

if(newkeys & KEY_YES)
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        new online[1000],offline[1000],query[300],result[30],name[30],idd,mid=1,aim2[2000];
        format(query, sizeof(query), "SELECT * FROM `friends` WHERE `PlayerID` = '%d' AND `Status`='1'",PlayerInfo[playerid][pSQLID]);
        new Cache: membresult = mysql_query(SQL,query);
        for(new i, j = cache_get_row_count (); i != j; ++i)
        {
            idd = cache_get_field_content_int(i, "FriendID");
            cache_get_field_content(i, "FriendName", result); format(name, 30, result);
            Selected[playerid][mid] = idd;
            format(online, sizeof(online), "%s{228404}[online]{FFFFFF} %s\n",online,name);
            mid++;
        }
        cache_delete(membresult);
        format(query, sizeof(query), "SELECT * FROM `friends` WHERE `PlayerID` = '%d' AND `Status`='0'",PlayerInfo[playerid][pSQLID]);
        new Cache: membresult1 = mysql_query(SQL,query);
        for(new i, j = cache_get_row_count (); i != j; ++i)
        {
            idd = cache_get_field_content_int(i, "FriendID");
            cache_get_field_content(i, "FriendName", result); format(name, 30, result);
            Selected[playerid][mid] = idd;
            format(offline, sizeof(offline), "%s{BB172D}[offline]{FFFFFF} %s\n",offline,name);
            mid++;
        }
        cache_delete(membresult1);
        format(aim2,sizeof(aim2),"{F89B0E}[+] Add Friend\n%s%s",online, offline);
        ShowPlayerDialog(playerid, DIALOG_FRIENDS, DIALOG_STYLE_LIST, "Friends", aim2, "Select", "Exit");
    }
}

 

Edited by StR_MaRy
Link to comment
Share on other sites

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.