Just a simple thing....... PLEASE SEE
#1

This is my code for engine starting...

I want the message ( SendClientMessage(playerid, 0xFFFFFFAA, kurac ); ) to be shown only to players that are in a 10 meter radius from the player who started the engine.... HOW please help me

Код:
CMD:veh(playerid, params[])
{
	new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
	if(strcmp(params, "Engine", true) == 0)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
	 		if(veh != INVALID_VEHICLE_ID)
			{
				if(EngineStatus[playerid] == 0)
				{
					new kurac[64];
				    GetPlayerName(playerid, name, sizeof(name));
					format(kurac, sizeof(kurac), " %s has stopped his engine!", name);
					GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 1;
					SendClientMessage(playerid, 0xFFFFFFAA, kurac);
									}
				else if(EngineStatus[playerid] == 1)
				{
				    new kurac[64];
				    GetPlayerName(playerid, name, sizeof(name));
					format(kurac, sizeof(kurac), " %s has stopped his engine!", name);
					GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
					EngineStatus[playerid] = 0;
					SendClientMessage(playerid, 0xFFFFFFAA, kurac);
				}
			}
		}
		else {
		SendClientMessage(playerid, 0x00FF00FF, "{E31919}You are not in a vehicle!");
		}
Reply
#2

Mm,
pawn Код:
new Float:x, Float:y, Float:z;
GetVehiclePos(veh, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z)
{
      SendClientMessage(playerid, 0xFFFFFFAA, kurac );
}
That is how i would approach it.
Reply
#3

This could also work.

pawn Код:
if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10) {
Reply
#4

Thanks!
Reply
#5

[JnA]DukeNukem be polite ( new kurac.... mislim stvarno.... )
http://translate.******.hr/translate...&hl=hr&tab=wT#
Reply
#6

Quote:
Originally Posted by Antonio144
Посмотреть сообщение
[JnA]DukeNukem be polite ( new kurac.... mislim stvarno.... )
http://translate.******.hr/translate...&hl=hr&tab=wT#
hahaah :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)