How to disable commands while on Deathmatch Area?
#5

pawn Код:
if(strcmp("/dm1", cmdtext, true, 10) == 0)
 {
    if(InSpawn[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You can't use this command while on class selection");
    new pName[MAX_PLAYER_NAME];
    new string[128];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string, sizeof(string), "{FFFFFF}[SERVER]:{FF002B}%s has teleported to {FFFFFF}Deathmatch Area 1 - DM Area 1(/dm1)",pName);
    SendClientMessageToAll(COLOR_RED, string);
    SendClientMessage(playerid, COLOR_GREEN,"Welcome To DM Area");
    GameTextForPlayer(playerid,"~w~Welcome To ~r~Death ~g~Match ~y~Area 1",3000,3);
    SetPlayerPos(playerid,1050.6841,938.1620,18.5841);
    SetPlayerFacingAngle(playerid,143);
    SetPVarInt(playerid, "InDm", 1);
    return 1;
 }
pawn Код:
if(strcmp("/home", cmdtext, true, 10) == 0)
{
if(GetPVarInt(plaeyrid, "InDm") == 1) return SendClientMessage(playerid, red, "You cant do that while in DM!");
else
{
//your code
}
hope this helps

EDIT: i think else will not be theree.. hmm.. just try this and tell me
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)