Jump to content

Question

Posted

Buna sunt noua pe acest forum. Deci am nevoie de ajutor! Am bagat o comanda:

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

{

    new color1, color2;

    new tmp[256];

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp)) return SendClientMessage(playerid, GREEN, "Type /carcolor for car color change!");

    color1 = strval(tmp);

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp)) return SendClientMessage(playerid, GREEN, "Type /carcolor for car color change!");

    color2 = strval(tmp);

    ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);

    return 1;

}[/pawn]

Problema ar fi urmatoarea:

[pawn]C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1240) : error 017: undefined symbol "strtok"

C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1240) : error 033: array must be indexed (variable "tmp")

C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1243) : error 017: undefined symbol "strtok"

C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1243) : error 033: array must be indexed (variable "tmp")

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.[/pawn]

Ma puteti ajuta sa rezolv problemele astea? Multumesc! :D

M-am reapucat de Sa-MP & Script-ing!

4 answers to this question

Recommended Posts

  • Administrator
Posted

Pune asta jos in script

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

Data viitoare vezi cu titlul ala cum faci

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Posted

=-" post="149627" timestamp="1377849269"]

Pune asta jos in script

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

Data viitoare vezi cu titlul ala cum faci

Ok, sorry am alta erroare:

[pawn]C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1240) : error 017: undefined symbol "idx"

C:\Documents and Settings\xxx\Desktop\Servers Sa-MP\gamemodes\RDS.pwn(1243) : error 017: undefined symbol "idx"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

[/pawn]

M-am reapucat de Sa-MP & Script-ing!

  • Administrator
Posted

Si care sunt liniile unde iti da eroarea?

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

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.