/veh wont spawn as names
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
CMD:veh(playerid, params[])
{
    if (isnull(params)) return SendClientMessage(playerid, COLOUR_RED, "Usage: /veh [name]");

    new Model = GetVehicleModelIDFromName(params);
    if (Model == -1) return SendClientMessage(playerid, COLOUR_RED, "You did not enter a valid vehicle name!");

    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    PutPlayerInVehicle(playerid, CreateVehicle(Model, x, y, z, 0.0, -1, -1, -1), 0);
    return 1;
}
pawn Код:
GetVehicleModelIDFromName(vname[])
{
    for(new i = 0; i < sizeof (vNames); i++)
    {
        if ( strfind(vNames[i], vname, true) != -1 )
            return i + 400;
    }
    return -1;
}
id/and name?
Reply


Messages In This Thread
/veh wont spawn as names - by DerickClark - 29.03.2014, 04:18
Re: /veh wont spawn as names - by ManGoe - 29.03.2014, 04:27
Re: /veh wont spawn as names - by DerickClark - 29.03.2014, 04:29
Re: /veh wont spawn as names - by ManGoe - 29.03.2014, 04:33
Re: /veh wont spawn as names - by DerickClark - 29.03.2014, 04:37
Re: /veh wont spawn as names - by KilotD - 29.03.2014, 08:15
Re: /veh wont spawn as names - by DerickClark - 29.03.2014, 15:14
Re: /veh wont spawn as names - by ParadiseRP - 29.03.2014, 15:40
Re: /veh wont spawn as names - by Konstantinos - 29.03.2014, 15:43
Re: /veh wont spawn as names - by DerickClark - 29.03.2014, 15:46

Forum Jump:


Users browsing this thread: 3 Guest(s)