Car command with message with carname
#9

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Change this:
PHP код:
format (message128"You have spawned a %s."GetVehicleNames(carName)); 
to:
PHP код:
format (message128"You have spawned a %s."GetVehicleNames(ReturnVehicleID(carName))); 
If you don't mind, can you post that ReturnVehicleID stock for me?
Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
CMD:car(playerid, params[])
{
    if(PlayerInfo[playerid][pRights] < 3) SendClientMessage(playerid, COL_RED, "[SERVER]: You don't have the rights to use this command.");
    else if(isnull(params)) SendClientMessage(playerid, COL_RED, "[USAGE]: /car [vehicle name / model].");
    else{
        new Model = ReturnVehicleID(params);
        if(Model == INVALID_VEHICLE_ID)
        {
            if(strlen(params) > 8) params[8] = EOS;
            Model = strval(params);
            if(!(400 <= Model <= 611))
                return SendClientMessage(playerid, COL_RED, "[SERVER]: Vehicle name/id not found.");
        }
        new message[75], Float:pPos[4], vid;
        GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
        GetPlayerFacingAngle(playerid, pPos[3]);
        vid = CreateVehicle(Model, pPos[0], pPos[1], pPos[2] + 1, pPos[3], 0, 1, 60);
        PutPlayerInVehicle(playerid, vid, 0);
        format(message, sizeof(message), "You have spawned a %s.", GetVehicleNames(vid));
        SendClientMessage(playerid, COL_GREEN, message);
    }
    return 1;
}
Thank you, this worked.
Reply


Messages In This Thread
Car command with message with carname - by xX4m4zingXx - 27.01.2015, 16:51
Re: Car command with message with carname - by CalvinC - 27.01.2015, 17:18
Re: Car command with message with carname - by xX4m4zingXx - 27.01.2015, 17:33
Re: Car command with message with carname - by CalvinC - 27.01.2015, 17:44
Re: Car command with message with carname - by ATGOggy - 27.01.2015, 17:53
Re: Car command with message with carname - by xX4m4zingXx - 27.01.2015, 17:58
Re: Car command with message with carname - by xX4m4zingXx - 27.01.2015, 20:31
Re: Car command with message with carname - by Jefff - 27.01.2015, 21:00
Re: Car command with message with carname - by xX4m4zingXx - 28.01.2015, 19:58

Forum Jump:


Users browsing this thread: 2 Guest(s)