19.07.2010, 19:36
No... i need something to spawn all the vehicles.
I already made an array with all th vehicles and datas... only a few are missing.
They will be coming soon.
But I posted the code already.
And when i type something like "/spawn hydra" it
But when i type "/spawn avdsgbhjnck" it should give me something like "SERVER: Fahrzeug existiert nicht"
But it spawns me a pcj and shows me the id 521 ... whats wrong? (the pcj is in the place '62' in my array and i only do +400 when spawning)
BTW: i only tested with vehicles up to 520 and i commented the rest of my array
Regards
//EDIT: oh lol why the code is missing?!
CODE:
I already made an array with all th vehicles and datas... only a few are missing.
They will be coming soon.
But I posted the code already.
And when i type something like "/spawn hydra" it
But when i type "/spawn avdsgbhjnck" it should give me something like "SERVER: Fahrzeug existiert nicht"
But it spawns me a pcj and shows me the id 521 ... whats wrong? (the pcj is in the place '62' in my array and i only do +400 when spawning)
BTW: i only tested with vehicles up to 520 and i commented the rest of my array
Regards
//EDIT: oh lol why the code is missing?!
CODE:
Код:
CMD:spawn(playerid, params[])
{
if (IsPlayerAdmin(playerid) || Player[playerid][ALevel] >= 2)
{
new Float:x;
new Float:y;
new Float:z;
new Float:a;
new string[256];
for (new i=0; i<sizeof(CreatedVehicles); i++)
{
if (CreatedVehicles[i] == 0)
{
if (sscanf(params, "s", params[0]))
{
SendClientMessage(playerid, RED, "USAGE: /spawn [object]");
return 1;
}
for ( new j=0; j<gVehMAX; j++ )
{
if ( !strcmp(params[0], gVeh[j][eVeh_Name], true) )
{
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
CreatedVehicles[i] = CreateVehicle(j+400, x-3, y, z+4, a, 0, 0, -1);
format(string, sizeof(string), "Fahrzeug \"%s\" (ID: %d) wurde gespawnt.", gVeh[j][eVeh_Name], j+400);
SendClientMessage(playerid, PURPLE, string);
return 1;
}
}
SendClientMessage(playerid, RED, "SERVER: Fahrzeug existiert nicht");
}
}
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du bist nicht als Admin eingeloggt oder dein AdminLevel ist zu niedrig");
}
return 1;
}

