pawn Код:
CMD:pdl(playerid, params[])
{
if(IsACop(playerid) || PlayerInfo[playerid][pMember] == 1)
{
new string[128], type;
new VID = GetPlayerVehicleID(playerid);
if(sscanf(params, "d", type))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /siren [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
return 1;
}
switch(type)
{
case 1:
{
if(Siren[VID] == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
return 1;
}
new sendername[MAX_PLAYER_NAME];
Siren[VID] = 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 Put's a Police Siren on their vehicle", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
case 2:
{
if(Siren[VID] == 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle doesn't have a siren on it!");
return 1;
}
Siren[VID] = 0;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyObject(SirenObject[VID]);
format(string, sizeof(string), "* %s Takes the Police Siren Down.", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
default:
{
SendClientMessageEx(playerid, COLOR_WHITE, "Invalid license type! /pdl [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
}
}
}
else SendClientMessageEx(playerid, COLOR_GREY, "You're not authorised to use this command.");
return 1;
}
CMD:fdl(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 4)
{
new string[128], type;
new VID = GetPlayerVehicleID(playerid);
if(sscanf(params, "d", type))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /siren [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
return 1;
}
switch(type)
{
case 1:
{
if(Siren[VID] == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
return 1;
}
new sendername[MAX_PLAYER_NAME];
Siren[VID] = 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 Put's a Fire Dept Siren on their vehicle.", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
case 2:
{
if(Siren[VID] == 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle doesn't have a siren on it!");
return 1;
}
Siren[VID] = 0;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyObject(SirenObject[VID]);
format(string, sizeof(string), "* %s Takes the Fire Dept Light Down.", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
default:
{
SendClientMessageEx(playerid, COLOR_WHITE, "Invalid license type! /pdl [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
}
}
}
else SendClientMessageEx(playerid, COLOR_GREY, "You're not authorised to use this command.");
return 1;
}
CMD:adl(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 2)
{
new string[128], type;
new VID = GetPlayerVehicleID(playerid);
if(sscanf(params, "d", type))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /siren [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
return 1;
}
switch(type)
{
case 1:
{
if(Siren[VID] == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle already has a siren!");
return 1;
}
new sendername[MAX_PLAYER_NAME];
Siren[VID] = 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 Put's a Admin Light on their vehicle.", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
case 2:
{
if(Siren[VID] == 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle doesn't have a siren on it!");
return 1;
}
Siren[VID] = 0;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
DestroyObject(SirenObject[VID]);
format(string, sizeof(string), "* %s Takes the Admin Light Down.", sendername);
ProxDetector(40.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
default:
{
SendClientMessageEx(playerid, COLOR_WHITE, "Invalid license type! /pdl [type]");
SendClientMessageEx(playerid, COLOR_GRAD2, "Type: 1 = On, 2 = Off.");
}
}
}
else SendClientMessageEx(playerid, COLOR_GREY, "You're not authorised to use this command.");
return 1;
}
They are objects. You cannot change the color of them.
This one server has done it.
You can use this function to replace the texture of an object with the texture from another model in the game. Important Note: You MUST use ARGB color format, not RGBA like used in client messages etc.
It says I put a light on my vehicle but it doesnt show.