How to change this code to CMD
#2

DCMD or ZCMD ?

I will make using ZCMD for you.

pawn Код:
CMD:placeradar(playerid)
{
    if (IsPlayerInAnyVehicle (playerid))
    {
    if(IsCopSkin(playerid))
    {
    new vehid = GetPlayerVehicleID (playerid);
    if (VehRadarID [vehid] > -1) return 1;
         
    new Float: x, Float: y, Float: z, Float: a;
    GetVehiclePos (vehid, x, y, z);
    GetVehicleZAngle (vehid, a);
    SendClientMessage (playerid, COLOR_WHITE, "Radar Planes.");
    VehRadarID [vehid] = CreateObject (367, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 300.0);
    AttachObjectToVehicle (VehRadarID [vehid], vehid, 0.2, 0.50, 0.3, 0.0, 0.0, 90.0);
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerInVehicle (i, vehid))
    {
    PlayerTextDrawShow (i, RadarHud);
    PlayerTextDrawShow (i, Textdraw1);
    PlayerTextDrawShow (i, Textdraw2);
    }
    }
    }
    }
    return 1;
}

CMD:removeradar(playerid)
{
    if (IsPlayerInAnyVehicle (playerid))
    {
    if(IsCopSkin(playerid))
    {
    new vehid = GetPlayerVehicleID (playerid);
    if (VehRadarID [vehid] == -1) return 1;

    DestroyObject (VehRadarID [vehid]);
    SendClientMessage (playerid, COLOR_YELLOW, "Radar has been removed successfully.");
    VehRadarID [vehid] = -1;
    KillTimer (CheckingSpeed [vehid]);
    CheckingSpeed [vehid] = -1;
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerInVehicle (i, vehid))
    {
    PlayerTextDrawHide (i, RadarHud);
    PlayerTextDrawHide (i, Textdraw1);
    PlayerTextDrawHide (i, Textdraw2);
    }
    }
    }
    }
    return 1;
}

CMD:checkspeed(playerid)
{
    if (IsPlayerInAnyVehicle (playerid))
    {
    if(IsCopSkin(playerid))
    {
    new vehid = GetPlayerVehicleID (playerid);
    if (VehRadarID [vehid] == -1) return 1;
    CheckingSpeed [vehid] = SetTimerEx ("UpdateSpeed", 100, 1, "d", vehid);
    }
    }
    return 1;
}

CMD:stopchecking(playerid)
{
    if(IsCopSkin(playerid))
    {
    if (IsPlayerInAnyVehicle (playerid))
    {
    new vehid = GetPlayerVehicleID (playerid);
    if (CheckingSpeed [vehid] > 0)
    {
    KillTimer (CheckingSpeed [vehid]);
    CheckingSpeed [vehid] = -1;
    }
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (IsPlayerInVehicle (i, vehid))
    {
    PlayerTextDrawHide (i, RadarHud);
    PlayerTextDrawHide (i, Textdraw1);
    PlayerTextDrawHide (i, Textdraw2);
    }
    }
    }
    }
    return 1;
}
And don't forget to delete the OnPlayerCommandText callback if you are going to use ZCMD.
Reply


Messages In This Thread
How to change this code to CMD - by lulo356 - 30.12.2014, 19:47
Re: How to change this code to CMD - by Boot - 30.12.2014, 20:25
Re: How to change this code to CMD - by lulo356 - 30.12.2014, 20:41
Re: How to change this code to CMD - by lulo356 - 30.12.2014, 20:46
Re: How to change this code to CMD - by Boot - 30.12.2014, 20:52
Re: How to change this code to CMD - by iThePunisher - 30.12.2014, 20:53
Re: How to change this code to CMD - by lulo356 - 30.12.2014, 20:54
Re: How to change this code to CMD - by iThePunisher - 30.12.2014, 20:57
Re: How to change this code to CMD - by Boot - 30.12.2014, 20:59
Re: How to change this code to CMD - by lulo356 - 30.12.2014, 21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)