Car command with message with carname
#1

I have made/copied partly a car command and I want to add a message saying, "You spawned a/an [VEHICLENAME]"
How would I do that?
I tried something.
This is my code:
Код:
CMD:car(playerid, params[])
{
	new carName[100];
	new message[128];
	if(sscanf(params, "s[100]", carName)) return SendClientMessage(playerid, COL_RED, "[USAGE]: /car [vehiclename].");
	if (ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COL_RED, "[SERVER]: Vehicle name/id not found.");
	if (PlayerInfo[playerid][pRights] < 3) return SendClientMessage(playerid, COL_RED, "[SERVER]: You don't have the rights to use this command.");
	new Float:pPos[4], vid;
	GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
	GetPlayerFacingAngle(playerid, pPos[3]);
	vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1, pPos[3], 0, 1, 60);
	PutPlayerInVehicle(playerid, vid, 0);
	format (message, 128, "You have spawned a %s.", GetVehicleNames(carName));
	SendClientMessage(playerid, COL_GREEN, message);
	return 1;
}
But this doesn't work and just says: "You have spawned a [What you typed after /car]"
so if you typed the ID 1 it just says "You have spawned a 1".
I want it to say the vehicle name from that id.
Do any of you know how to do this?
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)