Jump to content
  • 0

Anti /goto Admin 6


I O B I T

Question

Cum pot sa fac ca un admin 1-5 sa nu poata da /goto la un admin de rank 6? 

Adica sa fie un fel de restrictie care poate fi " activata " dintr-o comanda.

ex :  /antigoto  si nu se mai poate teleporta nimeni la mine ( eu find admin 6 ) prin comanda /goto

Nush daca m-am exprimat corect dar sper sa inteleaga cineva ce am vrut eu sa zic. :) 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

comanda goto  din GM  ( daca ajuta cu ceva)  

 

CMD:goto(playerid, params[])
{
    new giveplayerid, splayer[25];
    new Float:gx, Float:gy, Float:gz;
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You need to login first.");
    if(PlayerInfo[playerid][pHelper] > 0 && HelperDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Trebuie sa fii la datorie ca sa folosesti aceasta comanda. Tasteaza /hod");
    if(sscanf(params,"s[25]", splayer)) return SendClientMessage(playerid, COLOR_SYN, "(SERVER):{FFFFFF} /goto <Player ID/Name>");
    {
        if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
        {
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);

        if(AFK[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You are sleeping.");

        format(gString, sizeof(gString), "%s a mers la %s.",GetName(playerid), GetName(giveplayerid));
        if(PlayerInfo[playerid][pAdmin]) CMDRaport(gString, 1, 0);
        else CMDRaport(gString, 0, 1);

        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(gString, sizeof(gString), "Admin %s s-a teleportat la tine!",GetName(playerid));
            SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }
        if (PlayerInfo[playerid][pHelper] >= 1)
        {
             format(gString, sizeof(gString), "Helper %s s-a teleportat la tine!",GetName(playerid));
             SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }

        SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));

        GetPlayerPos(giveplayerid, gx, gy, gz);
        if(GetPlayerState(playerid) == 2 && GetPlayerInterior(giveplayerid) == 0)
        {
            new gcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(gcar, gx, gy+4, gz);
        }
        else
        {
            SetPlayerPos(playerid, gx, gy+2, gz);
        }
        BizzEntered[playerid] = BizzEntered[giveplayerid];
        HouseEntered[playerid] = HouseEntered[giveplayerid];
        }
        else SendClientMessage(playerid, COLOR_ERROR, "Your admin/helper level is not high enough to use this command.");
    }
    return 1;
}
 

Link to comment
Share on other sites

  • 0

O sa iti dau un sistem care interzice ca cineva sa dea /goto /gethere /spec pe un admin lvl 6.

 

Prima data pui sus la gm:

new togspec[MAX_PLAYERS];

Apoi te duci la variabile mai exact la:

stock ResetVariables(playerid) {

Acolo adaugi:

togspec[playerid] = 0;

Apoi te duci pe acolo pe la comenzi si adaugi comanda asta:

CMD:specme(playerid, params[])
{
    if(IsPlayerConnected(playerid))
     {
        if(EstiFondator(playerid))
         if(togspec[playerid] == 1)
         {
             togspec[playerid] = 0;
             SCM(playerid,COLOR_WHITE,"[!] Acum orice helper/admin poate sa dea /spec/goto/gethere la tine.");
         }
        else
         {
             togspec[playerid] = 1;
            SCM(playerid,COLOR_WHITE,"[!] Acum helperii/adminii nu mai pot da /spec/goto/gethere la tine.");
        }
    }
    return 1;
}

 

Acum eu o sa iti pun pe comanda ta goto sa iti mearga sistemul asta.

Comanda aici:

CMD:goto(playerid, params[])
{
    new giveplayerid, splayer[25];
    new Float:gx, Float:gy, Float:gz;
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You need to login first.");
    if(PlayerInfo[playerid][pHelper] > 0 && HelperDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Trebuie sa fii la datorie ca sa folosesti aceasta comanda. Tasteaza /hod");
    if(sscanf(params,"s[25]", splayer)) return SendClientMessage(playerid, COLOR_SYN, "(SERVER):{FFFFFF} /goto <Player ID/Name>");
    {
        if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
        {
        if(togspec[id] == 1) return SCM(playerid,COLOR_YELLOW2,"{FFFFCC}Fondatorul este ocupat in acest moment, incearca mai tarziu.");
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);

        if(AFK[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You are sleeping.");

        format(gString, sizeof(gString), "%s a mers la %s.",GetName(playerid), GetName(giveplayerid));
        if(PlayerInfo[playerid][pAdmin]) CMDRaport(gString, 1, 0);
        else CMDRaport(gString, 0, 1);

        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(gString, sizeof(gString), "Admin %s s-a teleportat la tine!",GetName(playerid));
            SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }
        if (PlayerInfo[playerid][pHelper] >= 1)
        {
             format(gString, sizeof(gString), "Helper %s s-a teleportat la tine!",GetName(playerid));
             SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }

        SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));

        GetPlayerPos(giveplayerid, gx, gy, gz);
        if(GetPlayerState(playerid) == 2 && GetPlayerInterior(giveplayerid) == 0)
        {
            new gcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(gcar, gx, gy+4, gz);
        }
        else
        {
            SetPlayerPos(playerid, gx, gy+2, gz);
        }
        BizzEntered[playerid] = BizzEntered[giveplayerid];
        HouseEntered[playerid] = HouseEntered[giveplayerid];
        }
        else SendClientMessage(playerid, COLOR_ERROR, "Your admin/helper level is not high enough to use this command.");
    }
    return 1;
}

 

Daca vrei sa iti mearga si pe comenzile /spec si /gethere, te rog sa imi dai comenzi-le pentru ca fiecare gm are comenzi aproximativ diferite.

Ca sa activezi comanda dai /specme si iti va da un mesaj ca ai activat comanda, iar ca sa dezactivezi tot /specme si iti va da un mesaj ca s-a dezactivat.

 

Sau daca vrei sa  faci singur comenzi-le sa mearga adaugi la comanda cum am adaugat eu la comanda /goto:

if(togspec[playerid] == 1) return SCM(playerid,COLOR_YELLOW2,"{FFFFCC}Fondatorul este ocupat in acest moment, incearca mai tarziu.");

 

Bafta.

Edited by AlexBo$$

g4JGBJX.gif.31953391ab64171df562293ad37a0875.gif.9d26b39cd3270634d9cf89dcb43fba87.gif

 

 

Link to comment
Share on other sites

  • 0

@Iobit

ohh.. te duci unde ai toate variabile-le si scrii asa

new AntiGoto[MAX_PLAYERS];

Dupa cauti comanda cu CTRL + F si scrii :goto( si adaugi sub verificarea daca persoana respectiva ce foloseste comanda este sau nu logata pe server.

if(AntiGoto[giveplayerid] == 1) return SCM(playerid, -1, "Persoana respectiva are /goto dezactivat.");

si acum facem comanda, asta poate fi adaugata oriunde vrea trupul tau pe langa celelalte comenzi

CMD:antigoto(playerid)
{
	if(PlayerInfo[playerid][pAdmin] > 5) return SCM(playerid, -1, "Nu ai gradul necesar.");
	if(AntiGoto[playerid] == 0)
	{
	    AntiGoto[playerid] = 1;
        SCM(playerid, -1, "Acum nimeni nu poate folosi /goto la tine.");
	}
	else
	{
	    AntiGoto[playerid] = 0;
        SCM(playerid, -1, "Acum toti pot folosi /goto la tine.");
	}
	return 1;
}

 

Edited by StR_Marian

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0

Uite aici acum trebuie sa mearga:

CMD:goto(playerid, params[])
{
    new giveplayerid, splayer[25];
    new Float:gx, Float:gy, Float:gz;
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You need to login first.");
    if(PlayerInfo[playerid][pHelper] > 0 && HelperDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Trebuie sa fii la datorie ca sa folosesti aceasta comanda. Tasteaza /hod");
    if(sscanf(params,"s[25]", splayer)) return SendClientMessage(playerid, COLOR_SYN, "(SERVER):{FFFFFF} /goto <Player ID/Name>");
    {
        if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
        {
        if(togspec[playerid] == 1) return SendClientMessage(playerid,COLOR_YELLOW2,"{FFFFCC}Fondatorul este ocupat in acest moment, incearca mai tarziu.");
        if(GetPlayers(splayer) == INVALID_PLAYER_ID) return InvalidPlayer(playerid);
        else if(GetPlayers(splayer) == 1000) return ToManyResults(playerid);
        else if(GetPlayers(splayer) == 1001) return ShowResults(playerid, splayer);
        else giveplayerid = GetPlayers(splayer);

        if(AFK[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "You are sleeping.");

        format(gString, sizeof(gString), "%s a mers la %s.",GetName(playerid), GetName(giveplayerid));
        if(PlayerInfo[playerid][pAdmin]) CMDRaport(gString, 1, 0);
        else CMDRaport(gString, 0, 1);

        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            format(gString, sizeof(gString), "Admin %s s-a teleportat la tine!",GetName(playerid));
            SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }
        if (PlayerInfo[playerid][pHelper] >= 1)
        {
             format(gString, sizeof(gString), "Helper %s s-a teleportat la tine!",GetName(playerid));
             SendClientMessage(giveplayerid, COLOR_SYN2, gString);
        }

        SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));

        GetPlayerPos(giveplayerid, gx, gy, gz);
        if(GetPlayerState(playerid) == 2 && GetPlayerInterior(giveplayerid) == 0)
        {
            new gcar = GetPlayerVehicleID(playerid);
            SetVehiclePos(gcar, gx, gy+4, gz);
        }
        else
        {
            SetPlayerPos(playerid, gx, gy+2, gz);
        }
        BizzEntered[playerid] = BizzEntered[giveplayerid];
        HouseEntered[playerid] = HouseEntered[giveplayerid];
        }
        else SendClientMessage(playerid, COLOR_ERROR, "Your admin/helper level is not high enough to use this command.");
    }
    return 1;
}

Edited by AlexBo$$

g4JGBJX.gif.31953391ab64171df562293ad37a0875.gif.9d26b39cd3270634d9cf89dcb43fba87.gif

 

 

Link to comment
Share on other sites

  • 0

@AlexBo$$

I-am facut eu tutorial mai sus e ok.

  • Thanks 1

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

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.