habe hier fehler bei einem simplen /v command...
if(strcmp(cmd, "/v", true) == 0) // hier >>>>>>>error 017: undefined symbol "cmd"<<<<<<<<<<<<
{
new tmp[256], tmp2[256], tmp3[256];
tmp = strtok(cmdtext, idx); // hier >>>>>>>>>>error 017: undefined symbol "idx"<<<<<<<<<<<<<<
tmp2 = strtok(cmdtext, idx); //hier >>>>>>>>>>error 017: undefined symbol "idx"<<<<<<<<<<<<<<
tmp3 = strtok(cmdtext, idx); //hier >>>>>>>>>>error 017: undefined symbol "idx"<<<<<<<<<<<<<<
new model = strval(tmp);
new color1 = strval(tmp2);
new color2 = strval(tmp3);
if(!strlen(tmp))
{
SendClientMessage(playerid, yellow, "Falsche ModelID! [400-600]");
return 1;
}
if(!strlen(tmp2))
{
SendClientMessage(playerid, yellow, "Keine primär Farbe!");
return 1;
}
if(!strlen(tmp3))
{
SendClientMessage(playerid, yellow, "Keine sekundär Farbe!");
return 1;
}
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreateVehicle(model, x, y+2, z+1, a, color1, color2, -1);
new string[128];
format(string, sizeof(string), "Du hast ein Fahrzeug mit der ID: %d, der 1. Farbe: %d, und der 2. Farbe: %d gespawnt.", model, color1, color2);
SendClientMessage(playerid, yellow, string);
return 1;
}
ganz unten natürlich:
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;
}
wie bekomm cih die errors weg?