Blindfold system
#1

my Server have an blindflod system whith a black textdraw but pepple can see by press Tab can you help me with that
PHP Code:
new Text:BFText;
// Blindfold
    
BFText TextDrawCreate(641.1999511.500000"usebox");
    
TextDrawLetterSize(BFText0.00000049.378147);
    
TextDrawTextSize(BFText, -2.0000000.000000);
    
TextDrawAlignment(BFText3);
    
TextDrawColor(BFText, -1);
    
TextDrawUseBox(BFTexttrue);
    
TextDrawBoxColor(BFText255);
    
TextDrawSetShadow(BFText0);
    
TextDrawSetOutline(BFText0);
    
TextDrawBackgroundColor(BFText255);
    
TextDrawFont(BFText1);
CMD:bf(playeridparams[])
{
    new 
string[128], giveplayerid;
    if(
sscanf(params"u"giveplayerid)) return SendClientMessageEx(playeridCOLOR_GREY"SUDUNG: /ciabitmat [player]");
    if(
IsPlayerConnected(giveplayerid))
    {
        if(
PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
        {
            if(
ProxDetectorS(6.0playeridgiveplayerid))
            {
                new 
vehicle GetPlayerVehicleID(playerid);
                if(
IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == && IsPlayerInVehicle(giveplayeridvehicle))
                {
                    if(
GetPVarInt(giveplayerid"BlindFolded") == 0) {
                        if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY"Ban khong the tu bit mat."); return 1; }
                          
format(stringsizeof(string), "%s nguoi lai xe da bit mat ban lai."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "ban da bit mat %s."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "*nguoi lai xe %s da~ bit mat %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        
TextDrawShowForPlayer(giveplayeridBFText);
                        
//ShowPlayerNameTagForPlayer(giveplayerid, i, 0);
                        
for(new ii<MAX_PLAYERSi++)
                        {
                            if(
IsPlayerConnected(i))
                               {
                                
ShowPlayerNameTagForPlayer(giveplayeridi0);
                            }
                        }
                        
SetPVarInt(giveplayerid"BlindFolded"1);
                    }
                     else {
                        if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY" Ban khong the tu coi bit mat !"); return 1; }
                          
format(stringsizeof(string), "%s has removed the blindfold from over your eyes !"GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), " ** Ban da coi bit mat cho %s."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "* %s da coi bit mat cho %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        
TextDrawHideForPlayer(giveplayeridBFText);
                        for(new 
ii<MAX_PLAYERSi++)
                        {
                            if(
IsPlayerConnected(i))
                               {
                                
ShowPlayerNameTagForPlayer(giveplayeridi1);
                            }
                        }
                        
DeletePVar(giveplayerid"BlindFolded");
                    }
                }
                else
                {
                    if(
GetPVarInt(giveplayerid"BlindFolded") == 0) {
                        if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY"Ban khong the tu bit mat."); return 1; }
                          
format(stringsizeof(string), "%s da bit mat ban lai."GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "ban da bit mat %s."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_WHITEstring);
                        for(new 
ii<MAX_PLAYERSi++)
                        {
                            if(
IsPlayerConnected(i))
                               {
                                
ShowPlayerNameTagForPlayer(giveplayeridi0);
                            }
                        }
                        
format(stringsizeof(string), "*%s da~ bit mat %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        
TextDrawShowForPlayer(giveplayeridBFText);
                        
SetPVarInt(giveplayerid"BlindFolded"1);
                    }
                     else {
                        if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY" Ban khong the tu coi bit mat !"); return 1; }
                          
format(stringsizeof(string), "%s has removed the blindfold from over your eyes !"GetPlayerNameEx(playerid));
                        
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), " ** Ban da coi bit mat cho %s."GetPlayerNameEx(giveplayerid));
                        
SendClientMessageEx(playeridCOLOR_WHITEstring);
                        
format(stringsizeof(string), "* %s da coi bit mat cho %s."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        
TextDrawHideForPlayer(giveplayeridBFText);
                        for(new 
ii<MAX_PLAYERSi++)
                        {
                            if(
IsPlayerConnected(i))
                               {
                                
ShowPlayerNameTagForPlayer(giveplayeridi1);
                            }
                        }
                        
DeletePVar(giveplayerid"BlindFolded");
                    }
                }
            }
            else
            {
                
SendClientMessageEx(playeridCOLOR_GREY" Ban khong o gan nguoi do.");
                return 
1;
            }
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY" Ban khong duoc phep su dung lenh nay.");
            return 
1;
        }
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GREY"Ma Id cua nguoi choi khong hop le");
        return 
1;
    }
    return 
1;

Sorry for my bad at English
Reply
#2

it is samp related, you cant change it
Reply
#3

It is a SA-MP related function and cannot be altered. However, one solution is to set the player's camera to face a black screen (and then using SetCameraBehindPlayer when removing the blindfold):

pawn Code:
SetPlayerCameraPos(targetid, -833.5241, -1358.8575, 86.9054);
SetPlayerCameraLookAt(targetid, -833.5241, -1358.8575, 0.0000);
Reply
#4

Thanks very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)