|
At the top of your script:
Код HTML:
new vehiclecallsign[MAX_VEHICLES]; Код HTML:
CMD:callsign(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new string[32];
if(!IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "You're not in a vehicle.");
if (GetFactionType(playerid) != FACTION_POLICE)
return SendErrorMessage(playerid, "You must be a police officer.");
if (!IsACruiser(GetPlayerVehicleID(playerid)))
return SendErrorMessage(playerid, "You must be inside a police cruiser.");
if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 1)
{
Delete3DTextLabel(vehicle3Dtext[vehicleid]);
vehiclecallsign[vehicleid] = 0;
SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
return 1;
}
if(sscanf(params, "s[32]",string)) return SendErrorMessage(playerid, "You must enter a callsign.");
if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 0)
{
vehicle3Dtext[vehicleid] = Create3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.0, 10.0, 0, 1);
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0);
vehiclecallsign[vehicleid] = 1;
}
return 1;
}
|
CMD:callsign(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
new string[32];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a car.");
if(!IsACop(playerid) && !IsAHp(playerid) && !IsAHSF(playerid) && !IsASWAT(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an Law Enforcement officer.");
if( GetVehicleModel(vehicleid) == 596 || GetVehicleModel(vehicleid) == 597 || GetVehicleModel(vehicleid) == 427 || GetVehicleModel(vehicleid) == 523 || GetVehicleModel(vehicleid) == 599 || GetVehicleModel(vehicleid) == 601 )
if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Police cruiser.");
{
Delete3DTextLabel(vehicle3Dtext[vehicleid]);
vehiclecallsign[vehicleid] = 0;
SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
return 1;
}
if(sscanf(params, "s[32]",string)) return SendErrorMessage(playerid, "You must enter a callsign.");
if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 0)
{
vehicle3Dtext[vehicleid] = Create3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.0, 10.0, 0, 1);
Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0);
vehiclecallsign[vehicleid] = 1;
}
return 1;
}
{ //Line 18446 underneath
Delete3DTextLabel(vehicle3Dtext[vehicleid]);
vehiclecallsign[vehicleid] = 0;
SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
return 1;
}