SA-MP Forums Archive
Command.... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command.... (/showthread.php?tid=393242)



Command.... - Sp3cter - 17.11.2012

pawn Код:
dcmd_radar(playerid, params[])
{
    #pragma unused params
    if(IsPlayerConnected(playerid))
    {
        new sendername[MAX_PLAYER_NAME];
        new giveplayer[MAX_PLAYER_NAME];
        new string[128];
        new Speed[MAX_PLAYERS];
        new VehRadarID [MAX_VEHICLES];
        new vehid = GetPlayerVehicleID(playerid);
        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            sendername[strfind(sendername,"_")] = ' ';
            format(string, sizeof(string), "* %s a pus radarul si i-a dat drumul.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SendClientMessage(playerid, COLOR_GREEN, "Viteza vehiculelor din apropiere:");
            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(IsPlayerConnected(i) && i!=playerid)
                {
                    if(IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
                    {
                        if (ProxDetectorS(30.0, playerid, i) && Speed[i] > 15)
                        {
                            GetPlayerName(i, giveplayer, sizeof(giveplayer));
                            giveplayer[strfind(giveplayer,"_")] = ' ';
                            format(string, sizeof(string), "Vehicul:%s Nume:%s Viteza ~%dkm/h", VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400],giveplayer,Speed[i]);
                            SendClientMessage(playerid, COLOR_YELLOW, string);
                        }
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!");
            return 1;
        }
        return 1;
    }
    return 1;
}


I have that command , and i wanted to make it for my server , but that don't work .... i get Server : Unknow command when i use it .... all time