30.06.2011, 07:04
Erm, AddStaticVehicle(Ex) does work in commands...
(Ignore the _CHECK bits, they're just defines for permissions checks)
That command spawns every vehicle on the game, with no issues.
pawn Code:
dcmd_veh(playerid, params[])
{
HMOD_CHECK;
if(!strlen(params)) return SendClientMessage(playerid, COLOUR_RED, "Usage: /veh [model]");
if(strval(params) < 400 || strval(params) > 611) return SendClientMessage(playerid, COLOUR_RED, "Models start from 400 and end at 611");
if(strval(params) == 432 || strval(params) == 425 || strval(params) == 520)
{
ASH_CHECK;
}
new Float:xx, Float:yy, Float:zz;
GetPlayerPos(playerid, xx, yy, zz);
SpawnedVehicles[LastSpawn] = AddStaticVehicleEx(strval(params), xx+2.5, yy+2.5, zz, 0.0, -1, -1, -1);
LastSpawn++;
return 1;
}
That command spawns every vehicle on the game, with no issues.