/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
#2

pawn Код:
dcmd_goto(playerid,params[])
{
    if(IsInDM[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "If you want to teleport use /leavedm");
        return 1;
    } else {

    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;
}
Reply
#3

pawn Код:
dcmd_goto(playerid,params[])
{
    if(IsInDM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"You cant use this command while in the dm zone !");
    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;
}
Reply
#4

just place if( isindm[playerid] ==1 ){
return SendClientMessage(..........
}
right beneath the cmd, i.e before the !strlen
Reply
#5

All the ideas gave me errors
Reply
#6

Well, show us the errors..
Reply
#7

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Well, show us the errors..
Well, if I use yours:

pawn Код:
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(484) : error 017: undefined symbol "UpdateConfig"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(485) : error 017: undefined symbol "ReadTextDraws"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(504) : error 017: undefined symbol "ShowConfigInConsole"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(529) : error 004: function "SaveTeleport" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(634) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(649) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(669) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(712) : error 017: undefined symbol "LoginPlayer"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(784) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(804) : error 017: undefined symbol "SavePlayerStats"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(832) : error 004: function "EraseVeh" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(838) : error 017: undefined symbol "AdvanceSpectate"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1045) : error 017: undefined symbol "AdvanceSpectate"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1062) : error 004: function "MessageToPlayerVIP" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1063) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1073) : error 004: function "MessageToAdmins" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1075) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1104) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1122) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1163) : error 017: undefined symbol "AdvertisementCheck"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1176) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1223) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1244) : error 004: function "SaveIn" is not implemented
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1522) : error 017: undefined symbol "TotalGameTime"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1845) : error 017: undefined symbol "ReturnUser"
C:\Users\Aрalsteinn\Desktop\modadmin\LuxAdmin System 1.6\LuxAdmin\filterscripts\Final edition\LuxAdmin.pwn(1867) : error 017: undefined symbol "SendCommandToAdmins"
Reply
#8

pawn Код:
if(IsInDM[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "If you want to teleport use /leavedm");
        return 1;
    }
Try this one, instead of the } else {
Reply
#9

Still 26 errors
Reply
#10

Hmm, try to change the return 1; to return 0;.. Last thing i could think of.
If that dont work, then you have to wait for other people
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)