DM Help!
#1

Hello! So, I wanna know how to stop all commands/teleports in DMs except /kill command! Can someone help me with this pls?
Here is my DM teleport:
Код:
if (strcmp("/apb", cmdtext, true, 10) == 0)
	{
			SetPlayerPos(playerid, 1493.9071,-1573.1179,67.2109);
			SetPlayerFacingAngle(playerid, 184.5182);
			SetCameraBehindPlayer(playerid);
			GameTextForPlayer(playerid,"WELCOME TO ALL POINTS BULLETIN",5000,3);
			new string[256], pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid, pname, sizeof(pname));
			format(string, sizeof(string), "%s has teleported to All Points Bulletin (/apb)", pname);
			SendClientMessageToAll(YELLOW, string);
			SendClientMessage(playerid,YELLOW,"Type /apbr for APB rules!");
			SendClientMessage(playerid,YELLOW,"Type /apbc for APB commands!");
			SendClientMessage(playerid,YELLOW,"Type /kill to leave APB!");
			ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST,"{FF002B}ALL POINTS BULLETIN","Enforcer\nCriminal","Spawn","Cancel");
			SetPlayerVirtualWorld(playerid, 0);
			return 1;
	}
Reply
#2

Anyone pls
Reply
#3

PLS PLS PLS help me!
Reply
#4

pawn Код:
new isInDM[MAX_PLAYERS] // Put this under your defines/includes

OnPlayerSpawn:
isInDM[playerid] = 0;

<This needs to be in your teleport command>
isInDM[playerid] = 1;


Put this in the commands you want to prevent if he is in a DM
if(isInDM[playerid] = 1)
{
    SendClientMessage(playerid, color_orange, "Please /kill yourself to teleport.");
    return 1;
}
Reply
#5

Dont works! When I put that i cant use any cmd!
Reply
#6

My bad,
pawn Код:
OnPlayerConnect:
isInDM[playerid] = 0;
Instead of OnPlayerSpawn
Reply
#7

Still dont works!
Can you give me an example of "disabled" command in DM pls
Reply
#8

Yeah sure
pawn Код:
if (!strcmp(cmdtext, "/fix"))
        {
        if(IsInDM[playerid] ==1)
        {
        SendClientMessage(playerid, red, "Please /kill yourself, then you can fix your car");
        return 1;
        }
                //This is the code when your NOT in DM
        RepairVehicle(GetPlayerVehicleID(playerid));
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, red, "Vehicle repaired");
        return 1;
        }
Reply
#9

This?

https://sampforum.blast.hk/showthread.php?tid=184332
Reply
#10

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Yeah sure
pawn Код:
if (!strcmp(cmdtext, "/fix"))
        {
        if(IsInDM[playerid] ==1)
        {
        SendClientMessage(playerid, red, "Please /kill yourself, then you can fix your car");
        return 1;
        }
                //This is the code when your NOT in DM
        RepairVehicle(GetPlayerVehicleID(playerid));
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
        SendClientMessage(playerid, red, "Vehicle repaired");
        return 1;
        }
IT WORKS! THANK YOU SO MUCH!! <3 <3 <3 <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)