#1

when I put a Nrg don't spawn the nrg.
but the number works, how I do name spawn?

pawn Код:
CMD:veh(playerid, params[])
{
    if(!strlen(params)) return SendClientMessage(playerid, COLOUR_RED, "Usage: /veh [id/name]");

    new iModel = 0;
    if(!IsNumeric(params))
    {
        for(new i; i < sizeof(vNames); i++)
        {
            if(!strcmp(params, vNames[i]))
            {
                iModel = i;
                break;
            }
        }
        if((iModel = 1)) return SendClientMessage(playerid, COLOUR_RED, "You did not enter a valid vehicle name!");
    }
    else iModel = strval(params);

    if(iModel > 611 || iModel < 400) return SendClientMessage(playerid, COLOUR_RED, "Vehicle models are between 400 and 611.");
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    PutPlayerInVehicle(playerid, CreateVehicle(iModel, x, y, z, 0.0, -1, -1, -1), 0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)