Jump to content

Question

9 answers to this question

Recommended Posts

  • 0
Posted

YCMD:duty(playerid, params[], help) {
    if(PlayerInfo[playerid][pGunLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai licenta de arme. Cauta un instructor pentru a obtine licenta.");
    new house = PlayerInfo[playerid][pHouse],string[200],sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(!IsACop(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti politist.");
    if(PlayerInfo[playerid][pSleeping] == 1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta comanda deoarece esti pe sleep!");
    if(GetPlayerVirtualWorld(playerid) == house || IsPlayerInRangeOfPoint(playerid, 150.0, 245.8297,112.4436,1003.2188) || IsPlayerInRangeOfPoint(playerid, 150.0, 236.3031,162.9478,1003.0300)) {
        if(GetPlayerInterior(playerid) != 0) {
            if(OnDuty[playerid] == 0) {
                if(PlayerInfo[playerid][pWantedLevel] != 0 || PlayerInfo[playerid][pJailTime] != 0) return SCM(playerid, COLOR_LGREEN, "Nu poti folosi aceasta comanda deoarece esti in jail sau ai wanted.");
                format(string, sizeof(string), "%s takes some guns and a badge from his locker.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                ServerWeapon(playerid, 24, 500);
                ServerWeapon(playerid, 3, 0);
                ServerWeapon(playerid, 41, 500);
                ServerWeapon(playerid, 29, 1000);
                ServerWeapon(playerid, 31, 1000);
                SetPlayerArmourEx(playerid, 99);
                SetPlayerHealthEx(playerid, 99);
                OnDuty[playerid] = 1;
                SetPlayerSkinEx(playerid, PlayerInfo[playerid][pChar]);
                SCM(playerid, -1, "You are now on duty!");                
            }
            else if(OnDuty[playerid]==1) {
                SCM(playerid, -1, "You are now off duty!");
                format(string, sizeof(string), "%s puts his badge and uniform in his locker.", sendername);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                OnDuty[playerid] = 0;
                SetPlayerArmourEx(playerid, 0);
                ResetWeapons(playerid);
                SetPlayerSkinEx(playerid, 305);
                NearWanted[playerid] = 0;
                PlayerTextDrawHide(playerid, NearTD);
                tazer[playerid] = 0;
                //SCM(playerid, COLOR_LGREEN, "Optiune dezactivata!");                
            }
            SetPlayerToTeamColor(playerid);
        }
        else SCM(playerid, COLOR_GREY, "You can only use this command in houses or in Police HQ.");
    }
    else SCM(playerid, COLOR_GREY, "You can only use this command in houses or in Police HQ.");
    return 1;
}

 

  • 0
Posted

function SetPlayerToTeamColor(playerid) {
    if(IsPlayerConnected(playerid)) {
        if(IsACop(playerid) && OnDuty[playerid] == 0) return SetPlayerColor(playerid, COLOR_WHITE);
        switch(PlayerInfo[playerid][pMember]) {
            case 0: SetPlayerColor(playerid,COLOR_WHITE);
            case 1: SetPlayerColor(playerid, 0x112ef2FF); 
            case 2: SetPlayerColor(playerid, 0x2b45f5FF); 
            case 3: SetPlayerColor(playerid, 0x01026bFF); 
            case 4: SetPlayerColor(playerid, 0x0CAB3CFF); 
            case 5: SetPlayerColor(playerid, 0x11F2F2FF);
            case 6: SetPlayerColor(playerid, 0xFAD400FF);
            case 7: SetPlayerColor(playerid, 0x00FF80FF); 
            case 8: SetPlayerColor(playerid, 0xFFFFA8FF); 
            case 9: SetPlayerColor(playerid, 0xFFABFCFF); 
            case 10: SetPlayerColor(playerid, 0xAB00FAFF); 
            case 11: SetPlayerColor(playerid, 0x7E3937FF); 
            case 12: SetPlayerColor(playerid, COLOR_YELLOW); 
            case 13: SetPlayerColor(playerid, 0xf86448FF);     
        }    
    }
    return 1;
}

 

  • 0
Posted
Acum 16 ore, jumainkain a spus:

Daca ai gm burned, probabil ai functia IfIsACop, cauta si adaugi acolo alt pMember si pLeader si id factiune, vezi tu acolo, intelegi ce vreau sa zic

Sunt adaugate , 

function IsACop(playerid) {
    new leader = PlayerInfo[playerid][pLeader], member = PlayerInfo[playerid][pMember];
    if(member==1 || member==2 || member==3 || member==14) return 1;
    else if(leader==1 || leader==2 || leader==3 || leader==14) return 1;
    return 0;

  • 0
Posted
Acum 17 ore, SherKan a spus:

ai cumva in server si variabila [pLeader] ?

Da , este adaugata acea variabila.

  • 0
Posted

incearca sa pui in loc de 

switch(PlayerInfo[playerid][pMember]) {..
switch(PlayerInfo[playerid][pMember]+PlayerInfo[playerid][pLeader]) {

 

Citat

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.