Jump to content

Recommended Posts

Posted
CMD:report(playerid, params[]) {
new result[256], string[128], name[MAX_PLAYER_NAME];
if(sscanf(params, "us[256]", result)) return SCM(playerid, -1, "/report <text>");
if(strlen(result) < 5) return SCM(playerid, -1, "Reportul tau este prea scurt!");
if(Report[playerid] == 1) return SCM(playerid, -1, "Ai dat deja un report,asteapta un raspuns!");
Report[playerid] = 1;
GetPlayerName(playerid, name, sizeof(name));
format(string, 256, "Report from %s (%d) : %s", name, playerid, result);
SendAdminMessage(0xD90707FF, string);
SendClientMessage(playerid, -1, "Report-ul tau a fost trimis adminilor!");
format(ReportText[playerid], 256, result);
return 1;
}
 
cind scriu /report dfgdfgdfgdfgdfd nu se trimite,imi scrie /report <text>   Unde am gresit?

https://pastebin.com/VVzCkDrg iata comanda ,in caz ca nu se cunoaste aici in topic

Posted (edited)

inlocuieste 

if(sscanf(params, "us[256]", result)) return SCM(playerid, -1, "/report <text>");

cu

if(sscanf(params, "s[256]", result)) return SCM(playerid, -1, "/report <text>");

Sa-ti explic de ce. Fiecare litera pe care o pui in sscanf are o specificatie, in cazul tau, us[256].. 

u - numele sau id-ul jucatorului

s - string

Specifier(s)            Name                Example values
    i, d            Integer                1, 42, -10
    c            Character            a, o, *
    l            Logical                true, false
    b            Binary                01001, 0b1100
    h, x            Hex                1A, 0x23
    o            Octal                045 12
    n            Number                42, 0b010, 0xAC, 045
    f            Float                0.7, -99.5
    g            IEEE Float            0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
    u            User name/id (bots and players)    Y_Less, 0
    q            Bot name/id            ShopBot, 27
    r            Player name/id            Y_Less, 42

btw... s[256] la tine e prea mult, nu poti pune mai mult de 128 de litere in casuta de text sa:mp.

Edited by Un4m3d_Hokage
Posted
Eroare:
if(sscanf(params, "us[256]", result)) return SCM(playerid, -1, "/report <text>");

Normal, cam asa se face:
if(sscanf(params, "us[256]", player, result)) return SCM(playerid, -1, "/report <text>");

Dar la tine poti face asa:
if(sscanf(params, "s[128]", result)) return SCM(playerid, -1, "/report <text>");

 Comanda ta, fara erori:

CMD:report(playerid, params[]) {
    new result[256], string[128], name[MAX_PLAYER_NAME];
    if(sscanf(params, "s[128]", string)) return SCM(playerid, -1, "/report <text>");
    if(strlen(string) < 5) return SCM(playerid, -1, "Reportul tau este prea scurt, minim 5 caractere!");
    if(Report[playerid] == 1) return SCM(playerid, -1, "Ai dat deja un report,asteapta un raspuns!");
    Report[playerid] = 1;
    GetPlayerName(playerid, name, sizeof(name));
    format(result, sizeof(result), "Report from %s (%d) : %s", name, playerid, string);
    SendAdminMessage(0xD90707FF, result);
    SendClientMessage(playerid, -1, "Report-ul tau a fost trimis adminilor!");
    format(ReportText[playerid], sizeof(string), string);
    return 1;
}
  • 5 years later...
Posted

 buna ziua!!  in data de 07 02 2023 am convenit cu  un jucator cu nick :Riven sa fac 100km masinii cu id 482022 acesta platind cu 13.000.000 $ la final . Acesta in momentul finalizarii intelegerii s-a deconectat ( atasez in link screen cu dovezile necesare) Multumesc!!https://imgur.com/a/ZBqlI5D

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.

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

moduri samp