Jump to content
  • 0

Help


RobertN

Question

Salut. Am facut o comanda dar e gresit ceva si nu stiu ce .

[pawn]if(strcmp(cmd, "/event", true) == 0)

{

if(IsPlayerConnected(playerid))

{

new text;

text = strval(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /event [DenumireEvent]");

return 1;

}

GetPlayerName(playerid, sendername, sizeof(sendername));

for(new i = 0; i <= MAX_PLAYERS; i ++)

  {

format(string, sizeof(string), "{FF0000}%s{FFFFFF} face event %d /w pentru tp !",sendername,text);

SendClientMessage(i, COLOR_LIGHTRED, string);

}

}

return 1;

}[/pawn]

Cand scriu /event Deagle arata de ex: Nume face event "0" /w pentru tp , nu stiu de ce apare 0 , cum fac sa poata apara ce scriu eu ?

Sper sa ma ajutati, sunt mai la inceput ;)

<3 FCP 3>

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Buna seara RobertN

Foloseste mai simplu aceasta comanda.Comanda nu este testata asa ca daca vei intampina vreo eroare nu ezita sa o postezi aici.

[pawn]if (strcmp("/event", cmdtext, true) == 0)

    {

        new string[128];

        new pName[MAX_PLAYER_NAME], string[128]; GetPlayerName(playerid, pName, sizeof pName);

        format(string,sizeof string,"%s face event de tip %s , /w catre el pentru tp/informatii.",pName, string);

        SendClientMessageToAll(0x0000ffff,string);

        return 1;

    }[/pawn]

Simplu dar la obiect.

Sper ca ti-am fost de folos,

[Pawn]

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

Link to comment
Share on other sites

Salut [pawn]. Am incercat comanda de la tine dar primesc urmatoarele erori :

warning 219: local variable "string" shadows a variable at a preceding level

error 021: symbol already defined: "string"

warning 204: symbol is assigned a value that is never used: "string"

<3 FCP 3>

Link to comment
Share on other sites

Buna ziua RobertN

In ce mi-ai aratat tu nu sunt toate erori.Ai prezente 1 eroare si 2 warning-uri.Daca gamemode-ul tau are erori atunci .amx nu va fi prezent iar daca ai cateva warning-uri amx. va aparea.

Acum,eroarea acea apare din cauza ca : string-ul este deja definit.

Daca te-ai fi uitat putin si ti-ai fi batut capul iti dadeai seama.Uite aici :

[pawn]if (strcmp("/event", cmdtext, true) == 0)

    {

        new string[128];

        new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof pName);

        format(string,sizeof string,"%s face event de tip %s , /w catre el pentru tp/informatii.",pName, string);

        SendClientMessageToAll(0x0000ffff,string);

        return 1;

    }[/pawn]

Sper ca ti-am fost de folos,

[Pawn]

Pentru suport nu ezitati sa ma contactati printr-un mesaj privat sau un mesaj pe Y/M.(Scripting sa:mp/cs,ScripturiWEB,phpbb,mysql,ipb,photoshop,html)

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.