03.06.2010, 06:38
Try this.
I just used i for the vehicle's id. I'm not sure how you organized it. It will work if you did it like cInfo[vehicleid][Name].
pawn Код:
dcmd_callcar(playerid, params[])
{
new carname;
if(sscanf(params, "s", carname))
{
SendClientMessage(playerid, COLOR_RED, "[Usage:] /callcar [car name]");
return 1;
}
for(new i; i<MAX_CARS; i++)
{
if(!strcmp(params,cInfo[i][Name],true))
{
new Float:px, Float:py, Float:pz,
GetPlayerPos(playerid, px, py, pz);
SetVehiclePos(i, px-5, py, pz); //i here will only work if the array is organized via vehicle ids
return 1;
}
}
return 1;
}