car spawning system
#9

You can merge a few things together:
PHP код:
command(vehplayeridparams[]) {
    new
        
vehicleid[30];
    if(
sscanf(params"s[30]"vehicleid)) {
        return 
SendClientMessage(playerid, -1"usage: /veh <name/modelid>");
    }
    if((
vehicleid[0] = GetVehicleModelByName(model)) == 0) {
        return 
SendClientMessage(playerid, -1"error: invalid model id.");
    }
    
CreateVehicleEx(playeridvehicleid);
    return 
true;
}
GetVehicleModelByName(const name[])
{
    if (
IsNumeric(name) && (strval(name) >= 400 && strval(name) <= 611))
        return 
strval(name);
    for (new 
0sizeof(NameVehicles); ++)
    {
        if (
strfind(NameVehicles[i], nametrue) != -1)
        {
            return 
400;
        }
    }
    return 
0;

Reply


Messages In This Thread
car spawning system - by CSLangdale - 05.04.2016, 18:56
Re: car spawning system - by Vanter - 05.04.2016, 19:05
Re: car spawning system - by CSLangdale - 05.04.2016, 19:09
Re: car spawning system - by AndySedeyn - 05.04.2016, 19:09
Re: car spawning system - by CSLangdale - 05.04.2016, 19:12
Re: car spawning system - by AndySedeyn - 05.04.2016, 19:12
Re: car spawning system - by CSLangdale - 05.04.2016, 19:14
Re: car spawning system - by Vanter - 05.04.2016, 19:16
Re: car spawning system - by AndySedeyn - 05.04.2016, 19:16
Re: car spawning system - by CSLangdale - 05.04.2016, 19:21

Forum Jump:


Users browsing this thread: 2 Guest(s)