Some commands when player is masked
#1

Hey I'm making some commands and I'm not sure how to make if player is masked the command will do SAME thing but message will be changed a bit so player's name will be replaced with "Stranger" here is the code:
pawn Код:
if(strcmp(cmd, "/cigsmoke", true) == 0)
    {
        if(IsDown[playerid] == 1 || IsDown[playerid] == 2) { return SendClientMessage(playerid,0xFF0000AA,"You can't do this while incapacitated."); }
        if(Cig[playerid] == 0) return SendClientMessage(playerid,0xFF0000AA,"You dont have a cigrette!");
        GetPlayerName(playerid, sendername, sizeof(sendername));
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
        format(string, sizeof(string), "*%s opens the cigarette package, pulls out a cigarette and lights it up.", sendername);
        ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
        Cig[playerid] --;
       
        if(Masked[playerid] == 1) // checking if the person is masked
        {
            if(IsDown[playerid] == 1 || IsDown[playerid] == 2) { return SendClientMessage(playerid,0xFF0000AA,"You can't do this while incapacitated."); }
            if(Cig[playerid] == 0) return SendClientMessage(playerid,0xFF0000AA,"You dont have a cigrette!");
            GetPlayerName(playerid, sendername, sizeof(sendername));
            SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
            format(string, sizeof(string), "*Stranger opens the cigarette package, pulls out a cigarette and lights it up.", sendername);
            ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
            Cig[playerid] --;
            return 1;
        }
        return 1;
    }
And how in this format I'm not using any strings so I guess I need to replace this with other code ^^
Thanks in advance

EDIT: and about return 1; is it even needed at end of if(Masked)... ?
Reply


Messages In This Thread
Some commands when player is masked - by Lajko1 - 14.10.2013, 15:39
Re: Some commands when player is masked - by Dragonsaurus - 14.10.2013, 15:42
Re: Some commands when player is masked - by Lajko1 - 14.10.2013, 15:47
Re: Some commands when player is masked - by Lajko1 - 14.10.2013, 15:55
Re: Some commands when player is masked - by Dragonsaurus - 14.10.2013, 16:05
Re: Some commands when player is masked - by Lajko1 - 14.10.2013, 16:23

Forum Jump:


Users browsing this thread: 1 Guest(s)