Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

ajutatima si pe mine sa fac comanda /status

nu inteleg care-i treba cu new tmp si strtok, ma rog, imi tot da o eroare

asta e comanda:

1  if (strcmp("/status", cmdtext, true, 10) == 0)
2  {
3        new tmp[256];
4        tmp = strtok(cmdtext, idx);
5        Update3DTextLabelText(status[playerid], 0x008080FF, sizeof(tmp));
6        Attach3DTextLabelToPlayer(status[playerid], playerid, 0.0, 0.0, 0.7);
7        return 1;
8  }
si imi da eroarea asta
line 4 : error 017: undefined symbol "strtok"
line 4 : error 033: array must be indexed (variable "tmp")
line 5 : error 035: argument type mismatch (argument 3)

cine ma poate ajuta?

4 answers to this question

Recommended Posts

Posted

De ce nu o faci in felul urmator?:

if (strcmp(cmd, "/status", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

                new giveplayer[MAX_PLAYER_NAME];

GetPlayerName(playeridi, giveplayer, sizeof(giveplayer));

                format(string, sizeof(string), "%s", giveplayer);

SendClientMessage(playerid, COLOR_YELLOW, string);

                format(string, sizeof(string), "Level [%d]", PlayerInfo[playerid][pLevel]);

SendClientMessage(playerid, COLOR_YELLOW, string);

    }

    return 1;

}

ps: cred ca la asta te-ai referit si sper sa mearga :)....

Posted

nup  :P

la comanda /status trebuia sa apara deasupra capului un scris pus de player, care sa fie statusul sau

eu defapt nu inteleg care e traba cu tm si strtok ca imi tot da erorile astea

line 4 : error 017: undefined symbol "strtok"
line 4 : error 033: array must be indexed (variable "tmp")
line 5 : error 035: argument type mismatch (argument 3)

Posted
1  if (strcmp("/status", cmdtext, true, 10) == 0)
2  {
3        new tmp[256], idx;
4        tmp = strtok(cmdtext, idx);
5        Update3DTextLabelText(status[playerid], 0x008080FF, sizeof(tmp));
6        Attach3DTextLabelToPlayer(status[playerid], playerid, 0.0, 0.0, 0.7);
7        return 1;
8  }

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.