Hier mein Code hier aus dem Forum:
Code
if(!strcmp(cmd, "/spawn", true))
{
new carmodel[256];
carmodel = strtok(cmdtext, idx);
if(!strlen(carmodel)) return SendClientMessage(playerid, 0x00FFFFFF, "[USAGE]: \"/spawn [modelid]\"");
new carmodelid = strval(carmodel);
if(carmodelid < 400 || carmodelid > 611) return SendClientMessage(playerid, 0x00FFFFFF, "[ERROR]: Invalid model id!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
CreateVehicle(carmodelid, X, Y+2, Z+1, A, -1, -1, 120);
new string[256];
format(string, 256, "[SUCESS]: Spawned a vehicle with modelid %d", carmodelid);
SendClientMessage(playerid, 0x00FFFFFF, string);
return 1;
}
return 0;
}
Alles anzeigen
Nun habe ich allerdings 2 Errors:
(80) : error 017: undefined symbol "cmd"
(83) : error 033: array must be indexed (variable "carmodel")