cannot use cmd help
#1

Can i make if an player does /minigun, they teleport to minigun but they cannot use any commands expect /leavedm
Reply
#2

yes you can make this
Reply
#3

i neeed help how to make it -.-
Reply
#4

pawn Код:
new IsPlayerInDMzone[MAX_PLAYERS];

COMMAND:minigun(pplayerid, params[])
{
    IsPlayerInDMzone[playerid] = 1;
    //stuff stuff
}

COMMAND:leavedm(playerid, params[])
{
    IsPlayerInDMzone[playerid] = 0;
    //stuff stuff
}

COMMAND:anothercommand(playerid, params[])
{
    if(IsPlayerInDMzone[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFAA, "You cannt teleport to another place when your in a DM zone use /leavedm first!");
    //stuff stuff
}
Reply
#5

i have to make that in all my cmds 50+ -.-?
Reply
#6

Yeah, idk if there is a more simple method

i'm not a advanced sripter but i know some ticks
Reply
#7

pawn Код:
if(IsPlayerInDMzone[playerid] == 1) return 0;
on OnPlayerCommandText (Works for strcmp and dcmd only, since it uses the OnPlayerCommandText callback ).
Reply
#8

how can i make it for zcmd?
Reply
#9

Use OnPlayerCommandReceived.
Reply
#10

You could do something like this:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{    
    if(IsPlayerInDMzone[playerid] == 1) return SendClientMesage(playerid, COLOR, "Get out from /minigun first.");
    return 1;
}
Reply
#11

Do it like CyberGhost said or modify the zcmd code.
Reply
#12

in ur gamemode / filterscript :
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(IsPlayerInDMzone[playerid] == 1)
    {
    SendClientMessage(playerid,COLOR_RED,"You're In Dm Zone You Can't Use Any Command");
    return 0;
    }
    return 1;
}
Edit : Was lagging didn't see above answers
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)