Hallo, ich bin neu im Scripten und wollte wissen was das IsACop ist und wie ich machen kann, das auch andere Fractionen /ucl können.
UCL:
//============================= Undercover Lights ======================//
if(!strcmp("/ucl",cmdtext,true))
{
if(IsACop(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560)
{
if(UCL[playerid] == 0)
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "undercover", CreateDynamicObject(19419,0,0,0,0,0,0));
AttachDynamicObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), 0.000000,-0.075000,0.828999,0.000000,0.000000,0.000000);
SendClientMessage(playerid, 0xFFFFFFAA, "Undercover Lichter Installiert. Lösch sie wieder mit /ucldel");
UCL[playerid] = 1;
}
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
{
if(UCL[playerid] == 0)
{
SetPVarInt(playerid, "Status", 1);
SetPVarInt(playerid, "undercover", CreateDynamicObject(19419,0,0,0,0,0,0));
AttachDynamicObjectToVehicle(GetPVarInt(playerid, "undercover"), GetPlayerVehicleID(playerid), 0.000000,-0.075000,0.688999,0.000000,0.000000,0.000000);
SendClientMessage(playerid, 0xFFFFFFAA, "Undercover Lichter Installiert. Lösch sie wieder mit /ucldel");
UCL[playerid] = 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"* Du musst in einem Undercovercar(Sultan) sitzen!");
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"* Du bist kein Polizist!");
}
return 1;
}
if(!strcmp("/ucldel",cmdtext,true))
{
if(IsACop(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560)
{
if(UCL[playerid] == 1)
{
DeletePVar(playerid, "Status");
DestroyDynamicObject(GetPVarInt(playerid, "undercover"));
SendClientMessage(playerid,COLOR_GRAD1,"* Undercover Lichter entfernt.");
UCL[playerid] = 0;
}
}
else if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 411)
{
if(UCL[playerid] == 1)
{
DeletePVar(playerid, "Status");
DestroyDynamicObject(GetPVarInt(playerid, "undercover"));
SendClientMessage(playerid,COLOR_GRAD1,"* Undercover Lichter entfernt.");
UCL[playerid] = 0;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"* Du bist in keine Auto!");
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD1,"* Du bist kein Polizist!");
}
return 1;
}