17.03.2016, 16:54
Error:
Script with first error:
guys help me pls
PHP код:
C:\Users\Kevin11\Desktop\Napoli\gamemodes\rp.pwn(1156) : error 017: undefined symbol "CMD"
PHP код:
CMD:spawnauto(playerid, params[])
{
new Float:vx, Float:vy, Float:vz, vid;
tmp = strtok(CMD, idx);
if (!strlen(tmp)) return SendClientMessage(playerid, 0xF69521AA, "Utilizza: /spawnauto [vehicleid/nome]");
if (IsNumeric(tmp) == 1)
{
vid = strval(tmp);
} else {
vid = GetVehicleIDFromName(tmp);
}
if ((vid < 400) || (vid > 611) || (vid == 590) || (vid == 569) || (vid == 570) || (vid == 537) || (vid == 538) || (vid == 449))
{
return SendClientMessage(playerid, 0xF69521AA, "Veicolo non riconosciuto.");
}
else
{
GetPlayerPos(playerid, vx, vy, vz);
CreateVehicle(vid, vx + random(9) - 4, vy + random(9) - 4, vz, 0, -1, -1, -1);
new car = GetPlayerVehicleID(playerid);
format(stringa,sizeof(stringa),"{0xF69521AA}T{0xF69521AA}D{0xFFFF00AA} %d",random(999));
SetVehicleNumberPlate(car, stringa);
SendClientMessage(playerid, 0xFFFF00AA, "Auto Spawnata con successo");
return 1;
}
}
return 0;
}
PHP код:
C:\Users\Kevin11\Desktop\Napoli\gamemodes\rp.pwn(3269) : error 021: symbol already defined: "strtok"
PHP код:
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;
}