Carcolor
#1

I want to make a /carcolor command but I got some errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], tmp[256], idx;
    if(strcmp(cmd, "/carcolor", true) == 0) {
        new color1, color2;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /carcolor [color1] [color2]");
        color1 = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /carcolor [color1] [color2]");
        color2 = strval(tmp);
        ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
        return 1;
    }
//More
pawn Код:
stock 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;
}
Errors:
pawn Код:
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(5574) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(5582) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(5643) : error 021: symbol already defined: "cmd"
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(5644) : error 021: symbol already defined: "idx"
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(5648) : warning 219: local variable "tmp" shadows a variable at a preceding level
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(6937) : error 001: expected token: ")", but found "&"
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(6937) : error 029: invalid expression, assumed zero
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(6937) : error 010: invalid function or declaration
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(6937 -- 6941) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Reply


Messages In This Thread
Carcolor - by Kostas' - 14.10.2011, 14:40
Re: Carcolor - by [GOD]Dragonster82 - 14.10.2011, 15:07
Re: Carcolor - by SmiT - 14.10.2011, 15:11
Re: Carcolor - by Kostas' - 14.10.2011, 15:30
Re: Carcolor - by MichaelNerd - 14.10.2011, 15:34
Re: Carcolor - by Kostas' - 14.10.2011, 15:43
Re: Carcolor - by MichaelNerd - 14.10.2011, 15:52
Re: Carcolor - by Kostas' - 14.10.2011, 16:02
Re: Carcolor - by MichaelNerd - 14.10.2011, 16:07
Re: Carcolor - by Kostas' - 14.10.2011, 16:11

Forum Jump:


Users browsing this thread: 1 Guest(s)