07.01.2012, 17:47
to be able to test it on my computer i had to convert this to dcmd but its easy to convert it back
Also i dont know what ur ProxyDetector function is doing so i just commented it.
No errors/warnings for me.
Also i dont know what ur ProxyDetector function is doing so i just commented it.
No errors/warnings for me.
pawn Код:
dcmd_siren(playerid,params[])
{
new siren[65],string[128],sendername[MAX_PLAYERS],SirenObject[MAX_PLAYERS],VID = GetPlayerVehicleID(playerid);
strmid(siren, params, 0, strlen(params), 255);
if(!strval(params))return SendClientMessage(playerid, -1, "USAGE: /siren [inside, roof, off]"),SendClientMessage(playerid, -1, "HINT: 'off' will remove the item from your vehicle.");
if(IsACop[playerid]==0)
{
if(strcmp(siren, "inside", true, strlen(siren)))
{
if(Siren[VID] == 1)return SendClientMessage(playerid, -1, "This vehicle already has a siren!");
Siren[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
AttachObjectToVehicle(SirenObject[VID], VID, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
format(string, sizeof(string), "* %s puts the siren on the dashboard.", sendername);
//ProxDetector(30.0, playerid, string, -1,-1,-1,-1,-1);
}
else if(strcmp(siren, "roof", true, strlen(siren) == 0))
{
if(Siren[VID] == 1)return SendClientMessage(playerid, -1, "This vehicle already has a siren!");
Siren[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
SirenObject[VID] = CreateObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
AttachObjectToVehicle(SirenObject[VID], VID, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
format(string, sizeof(string), "* %s puts the siren on the roof.", sendername);
//ProxDetector(30.0, playerid, string, -1,-1,-1,-1,-1);
}
else if(strcmp(siren, "off", true, strlen(siren)) == 0 && Siren[VID] == 1)
{
if(Siren[VID] == 0)return SendClientMessage(playerid, -1, "This vehicle doesnt have a siren!");
Siren[playerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyObject(SirenObject[VID]);
format(string, sizeof(string), "* %s takes down the siren.", sendername);
//ProxDetector(30.0, playerid, string, -1,-1,-1,-1,-1);
}
}
else
{
SendClientMessage(playerid, -1, "You are not part of a Team!");
}
return 1;
}