car spawning system
#4

@Vanter, his CreateVehicleEx function deals with most of that. The command itself can be a lot simpler:

PHP код:
command(vehplayeridparams[]) {
    new
        
vehicleid[30];
    if(
sscanf(params"s[30]"vehicleid)) {
        return 
SendClientMessage(playerid, -1"usage: /veh <name/modelid>");
    }
    new
        
carid;
    if(
IsNumeric(vehicleid)) {
        
carid strval(vehicleid);
    }
    else {
        
carid GetVehicleModelID(vehicleid);
    }
    if(
carid 400 || carid 611) {
        return 
SendClientMessage(playerid, -1"error: The vehicle ID/Name you specified is invalid.");
    }
    
CreateVehicleEx(playeridcarid);
    return 
true;

The code is not hard to understand, so I believe an explanation is not required.
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: 3 Guest(s)