/goto off in DM Zones
#1

Hello, I have changed all my teleports so that if player is in DM zone he can not tp with his guns(small bug), but he can still use /goto because I allow all players to use it, but how can I make it so players cant? This is the code that needs to be changed:
pawn Код:
dcmd_goto(playerid,params[])
{
    if(!strlen(params)) return
    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /goto [PlayerID]") &&
    SendClientMessage(playerid, orange, "Function: Will Go to specified player");
    new player1;
    new string[128];
    if(!IsNumeric(params))
    player1 = ReturnPlayerID(params);
    else player1 = strval(params);
    if(GetPVarInt(player1,"AdutyOn") == 1) return SendClientMessage(playerid, -1, "Admin is on duty, please do not disturb");
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
    {
        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),"|- You have Teleported to \"%s\" -|", pName(player1));
        return SendClientMessage(playerid,BlueMsg,string);
    }
    else return ErrorMessages(playerid, 4);
//  return 1;
}
This is the code I use for any other teleports, but its not the same kind of code so I dont understand how to do it

pawn Код:
if(strcmp(cmdtext, "/home", true) == 0)
{
    if(IsInDM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"If you want to teleport use /leavedm");
Reply


Messages In This Thread
/goto off in DM Zones - by ColdIce - 27.05.2011, 10:45
Re: /goto off in DM Zones - by Wesley221 - 27.05.2011, 10:50
Re: /goto off in DM Zones - by Elka_Blazer - 27.05.2011, 10:51
Re: /goto off in DM Zones - by xalith - 27.05.2011, 10:55
Re: /goto off in DM Zones - by ColdIce - 27.05.2011, 11:00
Re: /goto off in DM Zones - by Wesley221 - 27.05.2011, 11:07
Re: /goto off in DM Zones - by ColdIce - 27.05.2011, 11:10
Re: /goto off in DM Zones - by Wesley221 - 27.05.2011, 11:12
Re: /goto off in DM Zones - by ColdIce - 27.05.2011, 11:19
Re: /goto off in DM Zones - by Wesley221 - 27.05.2011, 11:24

Forum Jump:


Users browsing this thread: 1 Guest(s)