Definitly i need tooglegoto [rep+1] ! ! !
#1

Ello Guys :P
ehmm..
Listen up :P
Iam using Lux admin, and iam using luxadmin goto cmd too, so i need dcmd tooglegoto
what tooglegoto means? it means... example: when some one want to teleport to me and he's boring with that command, i can type /tooglegoto or /gotooff and no one can teleport to me.
I need it too much..
Thanks so much guys
REP+1!
Reply
#2

pawn Код:
"Top of your script:"
new gotost[MAX_PLAYERS];


"OnPlayerConnect:"
gotost[playerid] = 1;


"Replace the goto with this:"
dcmd_goto(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 0 || IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /goto [PlayerID]") &&
        SendClientMessage(playerid, orange, "Function: Will Go to specified player");
        new player1, string[128];
        if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
        else player1 = strval(params);
        if(gotost[player1] == 0)  return SendClientMessage(playerid, red, "You can't teleport to this player, because he disable the teleports to him.");
        if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || player1 == playerid) return SendClientMessage(playerid, red, "This player is not connected or is you.");
        SendCommandToAdmins(playerid,"Goto");
        new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
        SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
        if(GetPlayerState(playerid) == 2) {
        SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z );
        LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,GetPlayerInterior(player1));
        SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ),GetPlayerVirtualWorld(player1));
        }
        else SetPlayerPos(playerid,x+2,y,z);
        format(string,sizeof(string),"{FFFFFF}Teleported to {FF0000}\"%s\"", pName(player1));
        return SendClientMessage(playerid,blue,string);
        }
        else return ErrorMessages(playerid, 4);
}

dcmd_toggoto(playerid,params[]) {
 #pragma unused params
 if(gotost[playerid] == 1) {
 SendClientMessage(playerid, -1, "They can't teleport to you.");
 gotost[playerid] = 0;
 }
 else {
 SendClientMessage(playerid, -1, "They can teleport to you.");
 gotost[playerid] = 1;
 }
 return 1;
 }


"Add this under dcmd(goto, 4, cmdtext);:"
dcmd(toggoto, 7, cmdtext);
I use it in my LuxAdmin system.
Reply
#3

Don't forget to reset your variable under OnPlayerConnect or OnPlayerDisconnect, else the variable will still be the same as when the last player connected set it to.
Reply
#4

You have right, i edit my post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)