Kurze Frage wo finde ich die Bezeichnung der Cops bzw. Medics ?
Dispatch im Tagebuch vom Briefing
-
ZanchezDE -
5. April 2017 um 21:42 -
Geschlossen -
Erledigt
-
-
k.a was du meinst
evtl. das ?
description.extclass CfgNotifications {
-
Zitat
-
Moin,
folgendes müsstest Du da anpassen. So du musst die Queries in der handleMSG austauschen. Achtung Du solltest PPD und PRS durch den Namen deiner Cops bzw. Medics tauschen.
Code: handlemsgCops _toName = "PPD"; _query = format["INSERT INTO messages (fromID, toID, message, fromName, toName) VALUES('%1', 'PPD', '""%3""', '%4', 'PPD')",_pid,_toID,_msg,_fromName,_toName]; Medic _toName = "PRS"; _query = format["INSERT INTO messages (fromID, toID, message, fromName, toName) VALUES('%1', 'PRS', '""%3""', '%4', 'PRS')",_pid,_toID,_msg,_fromName,_toName];
Selbes gilt dann auf für die masgRequest
Code
Alles anzeigen_query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' ORDER BY time DESC",_uid]; if (side _player == independent) then { _query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' or toID = 'PRS' ORDER BY time DESC",_uid]; }; if (side _player == west) then { _query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' or toID = 'PPD' ORDER BY time DESC",_uid]; }; if (side _player == civilian) then { _query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' ORDER BY time DESC",_uid]; };
Der Teil hier : Achtung Du solltest PPD und PRS durch den Namen deiner Cops bzw. Medics tauschen.
-
Hast du keine eigenen Namen? dann nimm Cops und EMS
-
Also ist es hier egal welchen Namen man verwendet oder ist es an irgendetwas gebunden?
weil ich habe das erstmal so gemacht aber, ich hab da irgendwie einen Fehler mit rein gebracht weil keine Dispatches gespeichert werden
fn_handleMessages.sqf
private["_msg","_to","_target","_player","_type"];
_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_msg = [_this,1,"",[""]] call BIS_fnc_param;
_player = [_this,2,ObjNull,[ObjNull]] call BIS_fnc_param;
_type = [_this,3,-1] call BIS_fnc_param;
switch(_type) do{ //normal message
case 0: { if(isNULL _target) exitWith {};
_to = call compile format["%1", _target];
[_msg,name _player,0] remoteExec ["TON_fnc_clientMessage",_to];
private["_query","_pid","_toID"];
_pid = getPlayerUID _player;
_toID = getPlayerUID _target;
_msg = [_msg] call DB_fnc_mresString;
_fromName = name _player;
_toName = name _target;
_query = format["INSERT INTO messages (fromID, toID, message, fromName, toName) VALUES('%1', '%2', '""%3""', '%4', '%5')",_pid,_toID,_msg,_fromName,_toName];
_toName = "Polizei";
_query = format["INSERT INTO messages (fromID, toID, message, fromName, toName) VALUES('%1', 'Polizei', '""%3""', '%4', 'Polizei')",_pid,_toID,_msg,_fromName,_toName];
_toName = "Feuerwehr";
_query = format["INSERT INTO messages (fromID, toID, message, fromName, toName) VALUES('%1', 'Feuerwehr', '""%3""', '%4', 'Feuerwehr')",_pid,_toID,_msg,_fromName,_toName];
diag_log format["Query: %1",_query];
waitUntil{!DB_Async_Active};
[_query,1] call DB_fnc_asyncCall;
};
//message to cops
case 1: {
[_msg,name _player,1] remoteExec ["TON_fnc_clientMessage",west];
};
//to admins
case 2: {
[_msg,name _player,2] remoteExec ["TON_fnc_clientMessage",0];
};
//ems request
case 3: {
[_msg,name _player,5] remoteExec ["TON_fnc_clientMessage",independent];
};
//adminToPerson
case 4: { _to = call compile format["%1", _target];
if(isNull _to) exitWith {};
[_msg,name _player,3] remoteExec ["TON_fnc_clientMessage",_to];
};
//adminMsgAll
case 5: {[_msg,name _player,4] remoteExec ["TON_fnc_clientMessage",0];
};
};
fn_msgRequest.sqf
/* file: fn_msgRequest.sqf
Author: Silex
Fills the Messagelist
*/
private["_query", "_queryResult", "_uid", "_player"];
_uid = [_this, 0, "", [""]] call BIS_fnc_param;
_player = [_this, 1, ObjNull, [ObjNull]] call BIS_fnc_param;
_query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' ORDER BY time DESC",_uid];
if (side _player == independent) then
{
_query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' or toID = 'Feuerwehr' ORDER BY time DESC",_uid];
};
if (side _player == west) then
{
_query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' or toID = 'Polizei' ORDER BY time DESC",_uid];
};
if (side _player == civilian) then
{
_query = format["SELECT fromID, toID, message, fromName, toName FROM messages WHERE toID='%1' ORDER BY time DESC",_uid];
};
waitUntil {
!DB_Async_Active
};
_queryResult = [_query, 2, true] call DB_fnc_asyncCall;
if (count _queryResult == 0) exitWith {}; {
[1, _x] remoteExec["life_fnc_smartphone", _player];
}
forEach _queryResult;
_queryResult = [_query,2,true] call DB_fnc_asyncCall;
if(count _queryResult == 0) exitWith {};
{[1,_x] remoteExec ["life_fnc_smartphone",_player];
}forEach _queryResult;
-
Moin Moin,
hab auch eine frage :).
Gibt es auch die Möglichkeit Alle Dispatchnachrichten in einem extra Auftrags Fenster also einer eigenen .hpp datei anzuzeigen?
-