25.04.2011, 11:20
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
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!"); }