SA-MP Forums Archive
Will this work? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Will this work? (/showthread.php?tid=475869)



Will this work? - Lajko1 - 15.11.2013

Will this code hide player's name after he will enter from 1 interior to another interior for example house, shop, casino...

pawn Код:
forward EntWithMask(playerid);
public EntWithMask(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(playerid))
        {
            ShowPlayerNameTagForPlayer(i, playerid, 1);
        }
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new idx;
    new cmd[256];

    cmd = strtok(cmdtext, idx);
   
    // Public commands.
    if(strcmp("/enter", cmd, true) == 0) // enter property
    {
        if( lastPickup[playerid] != -1 || properties[lastPickup[playerid]][eType] > 0 ){
            new
                id = propPickups[lastPickup[playerid]],
                Float:x,
                Float:y,
                Float:z;

            GetPropertyEntrance( id, x, y, z );
            if( IsPlayerInRangeOfPoint( playerid, 3.0, x, y, z )){
                PutPlayerInProperty( playerid, id );
                SendClientMessage( playerid, 0xFFFFFFFF, "INFO:You have entered a property.. type /exit to leave" );
                return 1;
            }
            if(Masked[playerid] == 1) // If player will write /mask again his mask will be removed
            {
                MT[playerid] = SetTimerEx("EntWithMask", 1000, false, "i", playerid);
            }
        }
        return 1;
    }



Re: Will this work? - ReD_DeVi - 15.11.2013

yes it will