Command Request ( /toggoto )
#1

Hello Everyone i was searching for /toggoto command but could not found i need this command for my server i hope that you all no wat it does if player type /toggoto other player cant tele him using /goto please if anyone know.
Thanx in Advance.
plz dont give in CMD:
i dont use it i use
if(strcmp(cmdtext, "/toggoto", true) == 0)
Reply
#2

To start with, this isn't the place to request scripts at.

Second, we aren't people from Star Wars who can warp to you, look in your script, and create a command for you. We cannot creat a /toggoto command without knowing the script or just the /goto command but even if we could I'll say again:
This isn't the place to requests scripts.

Best regards,
Jesse
Reply
#3

Simple thing I whipped up.

pawn Код:
new gototog[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    gototog[playerid] = 0;
    return 1;
}

CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid))
    {
        return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
    }
    else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
    else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
    else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
    new Float: pos[3];
    GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, GetPlayerInterior(targetid));
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
    return 1;
}

CMD:toggoto(playerid, params[])
{
    if(gototog[playerid] == 0)
    {
        gototog[playerid] = 1;
        SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
    }
    else if(gototog[playerid] == 1)
    {
        gototog[playerid] = 0;
        SendClientMessage(playerid, -1, "Other players may teleport to you now!");
    }
    return 1;
}
/goto command I got from my own script. This simply creates a variable gototog, and sets it to 0 when the player joins (people can goto him). Then if they /toggoto, it sets it either disabled or disabled, depending on what it already is.

Untested, could work though. Tired, wasn't paying much attention while I scripted.
Reply
#4

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Simple thing I whipped up.

pawn Код:
new gototog[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    gototog[playerid] = 0;
    return 1;
}

CMD:goto(playerid, params[])
{
    new targetid, string[128];
    if(sscanf(params, "u", targetid))
    {
        return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
    }
    else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
    else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
    else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
    new Float: pos[3];
    GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
    SetPlayerInterior(playerid, GetPlayerInterior(targetid));
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
    return 1;
}

CMD:toggoto(playerid, params[])
{
    if(gototog[playerid] == 0)
    {
        gototog[playerid] = 1;
        SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
    }
    else if(gototog[playerid] == 1)
    {
        gototog[playerid] = 0;
        SendClientMessage(playerid, -1, "Other players may teleport to you now!");
    }
    return 1;
}
/goto command I got from my own script. This simply creates a variable gototog, and sets it to 0 when the player joins (people can goto him). Then if they /toggoto, it sets it either disabled or disabled, depending on what it already is.

Untested, could work though. Tired, wasn't paying much attention while I scripted.

Thankx!
But it make bug for my server when i type any wrong command doesnt show anything like uknown command it doesnt show it and got warning
warning 225: unreachable code and i just need is /toggoto and /goto command i already got :S
Reply
#5

Cripz, let me help you out with this one
Reply
#6

This in strcmp:
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
    {
        new targetid;
        if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this  cmdtext[6]
        {
            return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
        }
        else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
        else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
        else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
        new Float: pos[3];
        GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
        SetPlayerInterior(playerid, GetPlayerInterior(targetid));
        SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
        return 1;
    }

    if(strcmp(cmdtext, "/toggoto", true) == 0)
    {
        if(gototog[playerid] == 0)
        {
            gototog[playerid] = 1;
            SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
        }
        else if(gototog[playerid] == 1)
        {
            gototog[playerid] = 0;
            SendClientMessage(playerid, -1, "Other players may teleport to you now!");
        }
        return 1;
    }
You guyz don't read it? Crip said he wants the cmd in strcmp.

Copied and modified.
Source: Kindred
Reply
#7

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
This in strcmp:
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
    {
        new targetid;
        if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this  cmdtext[6]
        {
            return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
        }
        else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
        else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
        else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
        new Float: pos[3];
        GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
        SetPlayerInterior(playerid, GetPlayerInterior(targetid));
        SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
        return 1;
    }

    if(strcmp(cmdtext, "/toggoto", true) == 0)
    {
        if(gototog[playerid] == 0)
        {
            gototog[playerid] = 1;
            SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
        }
        else if(gototog[playerid] == 1)
        {
            gototog[playerid] = 0;
            SendClientMessage(playerid, -1, "Other players may teleport to you now!");
        }
        return 1;
    }
You guyz don't read it? Crip said he wants the cmd in strcmp.

Copied and modified.
Source: Kindred
Thankx.
Reply
#8

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
Cripz, let me help you out with this one
Thankx brah (;
Reply
#9

No problem but dude don't double post the last post can also be included in the second last using multi-qoute.

Anyway no problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)