Jump to content
  • 0

Errori...


Question

Posted

Salut.

Am adaugat in GM comanda /veh

if(strcmp(cmdtext, "/veh", true) == 0)
    {
        new tmp[256], idx, Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
             return SendClientMessage(playerid, 0xFFFFFFFF, "Sintaxa: /veh <id>");
        }
        new idcar = strval(tmp);
        if(idcar >= 400 && idcar <= 611) {} else return SendClientMessage(playerid, 0xFFFFFFFF, "Masinile sunt intre 400-611!");
        new created = CreateVehicle(idcar, X, Y, Z, 90.0, 0, 0, 0);
        PutPlayerInVehicle(playerid, created, 0);
        SendClientMessage(playerid, 0xFFFFFFFF, "Succes!");
        return 1;
    }
si de unde am luat CMD zice sa pun la sfarsit si strtok asta
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;
}
Si la complie imi da errorile astea
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(62496) : warning 208: function with tag result used before definition, forcing reparse
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(137) : warning 201: redefinition of constant/macro (symbol "DIALOG_STYLE_PASSWORD")
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(141) : error 010: invalid function or declaration
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(17468) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(21161) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(21161) : warning 219: local variable "idx" shadows a variable at a preceding level
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(21168) : warning 219: local variable "idcar" shadows a variable at a preceding level
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(62506) : error 021: symbol already defined: "strtok"
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(62523) : warning 203: symbol is never used: "CreatedCar"
C:\Documents and Settings\Owner\Desktop\CS\gamemodes\CS.pwn(62523) : warning 203: symbol is never used: "ad"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.

<a href="http://www.game-state.eu/94.60.40.50:7777/"><img src="http://www.game-state.eu/94.60.40.50:7777/n-560x95_FFFFFF_FFFFFF_000000_000000.png" alt="www.Game-State.eu" style="border-style: none;" /></a>

1 answer to this question

Recommended Posts

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.