14.10.2011, 14:40
I want to make a /carcolor command but I got some errors.
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;
}
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.