Jump to content
  • 0

Aod Command


MrAndrei

Question

Problema intalnita (descriere):Am creeat comanda /aod , insa , as dorii ca atunci cand tastezi [/aod] si te pui On Duty , sa apari cu o culoare pe mini-map.Va multumesc!
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul:-
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da.Nu am reusit.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

SetPlayerColor(playerid, 0xFF0000AA); // 0xFF0000AA - Rosu

 

Am acest lucru in comanda [/aod].

Uite,aceasta este comanda , eu nu vreau culoare la nume , vreau ca atunci cand tastezi [/aod] sa apara un checkpoint pe minimapa , la fel ca la checkpointurile de al un job/dmv,etc.

Mai precis , sa apara un patratel ''roz'' pe mini-map , numai atunci cand tastezi [/aod].Imi cer scuze ca nu stiu chiar cum sa va explic.Sper ca ati inteles.

if(!strcmp(cmdtext, "/aod", true) || !strcmp(cmdtext, "/aduty", true)) // By MrAndrei
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You need to login first !");
				return 1;
		    }
		    new admtext[64];
      		if(PlayerInfo[playerid][pAdmin] == 6) { admtext = "Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 5) { admtext = "Co-Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 4) { admtext = "Moderator"; }
            else if(PlayerInfo[playerid][pAdmin] == 3) { admtext = "Super-Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 2) { admtext = "Regular Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 1) { admtext = "Trial Admin"; }
		    else { admtext = "Owner"; }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
					SetPlayerHealth(playerid, 99999);
					SetPlayerArmour(playerid, 99999);
					SetPlayerColor(playerid, 0xFFB9DCFF);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is now on duty as an %s.Please /w him if you need help.",sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_LIGHTRED,string);
					if(PlayerInfo[playerid][pAdmin] >= 5)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerToTeamColor(playerid);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is no longer on duty as an %s.Please not /w him.", sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_WHITE,string);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You're not the admin !");
		        return 1;
		    }
		}
	    return 1;
	}
Link to comment
Share on other sites

  • 0

Incearca sa adaugi asta(cu modificarile de rigoare normal). Ti-am explicat exact ce inseamna fiecare lucru.

// Face jucatorul cu id 42 sa vada jucatorul cu id 1 pe radar, culoarea 0xFF0000FF
SetPlayerMarkerForPlayer( 42, 1, 0xFF0000FF );

Ar trebui sa faci ceva de genul asta:

for(new i; i < MAX_PLAYERS; i++)
{
    if(playerid != i) { SetPlayerMarkerForPlayer(i, playerid, 0xFFB6C1FF); }
}

Sa arati la toti jucatorii pe radar unde e adminul, adminului nu ii va aparea pe radar locatia lui marcata ca ar fi chiar absurd, stie deja unde e :lol:. Nu e testat codul dar ar trebui sa mearga.

Edited by Nightkill
Link to comment
Share on other sites

  • 0

Incearca sa adaugi asta(cu modificarile de rigoare normal). Ti-am explicat exact ce inseamna fiecare lucru.

// Face jucatorul cu id 42 sa vada jucatorul cu id 1 pe radar, culoarea 0xFF0000FF
SetPlayerMarkerForPlayer( 42, 1, 0xFF0000FF );

Ar trebui sa faci ceva de genul asta:

for(new i; i < MAX_PLAYERS; i++)
{
    if(playerid != i) { SetPlayerMarkerForPlayer(i, playerid, 0xFFB6C1FF); }
}

Sa arati la toti jucatorii pe radar unde e adminul, adminului nu ii va aparea pe radar locatia lui marcata ca ar fi chiar absurd, stie deja unde e :lol:. Nu e testat codul dar ar trebui sa mearga.

 

Am adaugat ce mi-ai dat tu la comanda [/aod] la AdminDuty==1 , insa tot nu merge.Alta modalitate , te rog ?

Link to comment
Share on other sites

  • 0

Ai adaugat ce ti-a dat el dupa mesajul care anunta server-ul ca esti on duty ca admin ?

 

I-a vezi asa :

if(!strcmp(cmdtext, "/aod", true) || !strcmp(cmdtext, "/aduty", true)) // By MrAndrei
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You need to login first !");
				return 1;
		    }
		    new admtext[64];
      		if(PlayerInfo[playerid][pAdmin] == 6) { admtext = "Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 5) { admtext = "Co-Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 4) { admtext = "Moderator"; }
            else if(PlayerInfo[playerid][pAdmin] == 3) { admtext = "Super-Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 2) { admtext = "Regular Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 1) { admtext = "Trial Admin"; }
		    else { admtext = "Owner"; }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
					SetPlayerHealth(playerid, 99999);
					SetPlayerArmour(playerid, 99999);
					SetPlayerColor(playerid, 0xFFB9DCFF);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is now on duty as an %s.Please /w him if you need help.",sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_LIGHTRED,string);
					for(new i; i < MAX_PLAYERS; i++)
					{
  						if(playerid != i) { SetPlayerMarkerForPlayer(i, playerid, 0xFFB6C1FF); }
					}
					if(PlayerInfo[playerid][pAdmin] >= 5)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerToTeamColor(playerid);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is no longer on duty as an %s.Please not /w him.", sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_WHITE,string);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You're not the admin !");
		        return 1;
		    }
		}
	    return 1;
	}
Edited by NoNamed
Link to comment
Share on other sites

  • 0

 

Ai adaugat ce ti-a dat el dupa mesajul care anunta server-ul ca esti on duty ca admin ?

 

I-a vezi asa :

if(!strcmp(cmdtext, "/aod", true) || !strcmp(cmdtext, "/aduty", true)) // By MrAndrei
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You need to login first !");
				return 1;
		    }
		    new admtext[64];
      		if(PlayerInfo[playerid][pAdmin] == 6) { admtext = "Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 5) { admtext = "Co-Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 4) { admtext = "Moderator"; }
            else if(PlayerInfo[playerid][pAdmin] == 3) { admtext = "Super-Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 2) { admtext = "Regular Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 1) { admtext = "Trial Admin"; }
		    else { admtext = "Owner"; }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
					SetPlayerHealth(playerid, 99999);
					SetPlayerArmour(playerid, 99999);
					SetPlayerColor(playerid, 0xFFB9DCFF);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is now on duty as an %s.Please /w him if you need help.",sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_LIGHTRED,string);
					for(new i; i < MAX_PLAYERS; i++)
					{
  						if(playerid != i) { SetPlayerMarkerForPlayer(i, playerid, 0xFFB6C1FF); }
					}
					if(PlayerInfo[playerid][pAdmin] >= 5)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerToTeamColor(playerid);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is no longer on duty as an %s.Please not /w him.", sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_WHITE,string);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You're not the admin !");
		        return 1;
		    }
		}
	    return 1;
	}

 

Voi incerca,revin cu edit daca functioneaza!Multumesc!

 

EDIT:Am adaugat ce mi-ai dat tu , insa nu functioneaza!

Chiar nu stiu ce sa mai fac..Alta modalitate?

Edited by MrAndrei
Link to comment
Share on other sites

  • 0

Pune un checkpoint pt toti playerii online...unde este playeru de foloseste aod...

Nu cred ca ai inteles, cand un admin da aod sa apara pe radar un punct , iar el daca se misca ( adminul ) sa se miste si punctul cu el.

Am inteles ce vr tu sa imi explici , dar nu este ceea ce doresc eu.

Link to comment
Share on other sites

  • 0

Pai ce este asa de greu?... Pui un timer sa "distruga" checkpointu pt playerii online si sa-l recreeze ... asa ca playerii v-or vedea pe "radar" acel punct :) si v-a sti unde sa mearga ... eu asa folosesc :) si imi merge perfect.

Link to comment
Share on other sites

  • 0

Uite,este comanda din propriul GM:

if(!strcmp(cmdtext, "/aod", true) || !strcmp(cmdtext, "/aduty", true)) // By AlyN
	{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Eroare: You need to login first !");
				return 1;
		    }
		    new admtext[64];
      		if(PlayerInfo[playerid][pAdmin] == 1340) { admtext = "Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 1339) { admtext = "Co-Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 1338) { admtext = "Head Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 1337) { admtext = "Lead Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 4) { admtext = "Super Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 3) { admtext = "Qualified Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 2)	{ admtext = "Regular Admin"; }
		    else if(PlayerInfo[playerid][pAdmin] == 1) { admtext = "Trial Admin"; }
		    else { admtext = "Outside"; }
		    if(PlayerInfo[playerid][pAdmin] > 0)
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
					SetPlayerHealth(playerid, 999);
					SetPlayerArmour(playerid, 999);
					SetPlayerColor(playerid, 0xFFB9DCFF);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is now on duty as an %s.Please /w him if you need help.",sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_LIGHTRED,string);
					if(PlayerInfo[playerid][pAdmin] >= 1337)
					{
					    for(new i = 0; i < sizeof(CarInfo); i++)
						{
							SetVehicleParamsForPlayer(i,playerid,0,0);
						}
					}
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerToTeamColor(playerid);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), " %s [ID:%d] is no longer on duty as an %s.Please not /w him.", sendername,playerid,admtext);
					SendClientMessageToAll(COLOR_WHITE,string);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_GREY, "Eroare: You're not the admin !");
		        return 1;
		    }
		}
	    return 1;
	}
Link to comment
Share on other sites

  • 0

Incearca asta:

CMD:aduty(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] <= 0) return SendClientMessage(playerid,-1,"Nu esti ADMIN.");
    if(OnDuty[playerid] == 0)
    {
        PlayerInfo[playerid][pAdminDuty] = 1;
        GameTextForPlayer(playerid,"~g~ on duty", 5000, 3);
        SetPlayerSkin(playerid,3); 
        SeteazaHP(playerid,100000);
        GivePlayerWeaponEx(playerid,31,133337);
        GivePlayerWeaponEx(playerid,32,133337);
        SetPlayerColor(playerid,0x00ffd5FF);
        OnDuty[playerid] = 1;
    }
    else
    {
        PlayerInfo[playerid][pAdminDuty] = 0;
        GameTextForPlayer(playerid,"~r~ off duty", 5000, 3);
        SetPlayerSkin(playerid,98); 
        SeteazaHP(playerid,100);
        ResetPlayerWeaponsEx(playerid);
        SetPlayerColor(playerid,0x00ffd500);
        OnDuty[playerid] = 0;
    }
    return 1;
}

Si adaugi linia asta la inceput unde ai declararile globale : new OnDuty[MAX_PLAYERS];

 

Sper sa iti mearga.

qua8n0lrq5wl5v5xccbk.png
 
mf79y6bvavi9sp2qqfoi.png
Contact: Mail: [email protected]
Y!M: r3mus.onlypro
Skype: r3mus.onlypro
Link to comment
Share on other sites

  • 0

Netul este mare.Daca cautai pe google ''problem minimap on players" ai fi gasit raspunsul.

 

Foloseste functia http://wiki.sa-mp.com/wiki/ShowPlayerMarkersalta data.

 

if(!strcmp(cmdtext, "/aod", true) || !strcmp(cmdtext, "/aduty", true)) // By MrAndrei
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You need to login first !");
                return 1;
            }
            new admtext[64];
              if(PlayerInfo[playerid][pAdmin] == 6) { admtext = "Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 5) { admtext = "Co-Owner"; }
            else if(PlayerInfo[playerid][pAdmin] == 4) { admtext = "Moderator"; }
            else if(PlayerInfo[playerid][pAdmin] == 3) { admtext = "Super-Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 2) { admtext = "Regular Admin"; }
            else if(PlayerInfo[playerid][pAdmin] == 1) { admtext = "Trial Admin"; }
            else { admtext = "Owner"; }
            if(PlayerInfo[playerid][pAdmin] > 0)
            {
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    SetPlayerHealth(playerid, 99999);
                    SetPlayerArmour(playerid, 99999);
                    SetPlayerColor(playerid, 0xFFB9DCFF);
                    ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), " %s [ID:%d] is now on duty as an %s.Please /w him if you need help.",sendername,playerid,admtext);
                    SendClientMessageToAll(COLOR_LIGHTRED,string);
                    if(PlayerInfo[playerid][pAdmin] >= 5)
                    {
                        for(new i = 0; i < sizeof(CarInfo); i++)
                        {
                            SetVehicleParamsForPlayer(i,playerid,0,0);
                        }
                    }
                    return 1;
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerToTeamColor(playerid);
                    ShowPlayerMarkers(    PLAYER_MARKERS_MODE_OFF);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), " %s [ID:%d] is no longer on duty as an %s.Please not /w him.", sendername,playerid,admtext);
                    SendClientMessageToAll(COLOR_WHITE,string);
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You're not the admin !");
                return 1;
            }
        }
        return 1;
    }
Edited by Adrian_Petre

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.