SA-MP Forums Archive
im looking for briefcase? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: im looking for briefcase? (/showthread.php?tid=196396)



im looking for briefcase? - GBLTeam - 05.12.2010

I see on some servers RPG there was to buy a BAG it was named /briefcase .. Can anyone give me that FS.


Re: im looking for briefcase? - Lynn - 06.12.2010

Well, on most RP servers, you must buy it from the 24-7.
Here is a command, just to place it away, and bring it out.
pawn Код:
if(strcmp(cmd, "/briefcase", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(BCase[playerid] == 0)// Makes sure the briefcase is putaway.
        {
            SetPlayerHoldingObject(playerid, 1210, 6,0.3,0.1,0,0,-90,0); // BriefCase
            SendClientMessage(playerid, COLOR_WHITE, " You have pulled out your briefcase. ");
            BCase[playerid] = 1;
            return 1;
        }
        else if(BCase[playerid] == 1)// Makes sure the briefcase is being used/
        {
            StopPlayerHoldingObject(playerid);
            SendClientMessage(playerid, COLOR_WHITE, " You have put away your briefcase. ");
            BCase[playerid] = 0;
            return 1;
        }
        return 1;
    }
    return 1;//Change to 0 if it's your only command.
}
Here is the command(Does same thing)
but you must purchase one from a 24-7 first.(GF Edit compatible)

If using a dialog, OnDialogResponse
pawn Код:
if(listitem == 14)//This is Number 14(in /buy), it has been bought. Change 14 to fit your script. This is in a Dialog.
{
    GivePlayerMoney(playerid, -50);
    PlayerInfo[playerid][pBCase] = 1;
    SendClientMessage(playerid, COLOR_WHITE, "** You now have a Briefcase, and can use /briefcase");
}
Top of Script.
pawn Код:
new BCase[MAX_PLAYERS];//Defines if you have the briefcase putaway / Being used.
Under, pInfo(If using GF / Edit of GF)
pawn Код:
pBCase,
Under, OnPlayerConnect
pawn Код:
BCase[playerid] = 0;//Sets the player to not have the briefcase out, when connecting.
pawn Код:
if(strcmp(cmd, "/briefcase", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pBCase] == 1)
        {
            if(BCase[playerid] == 0)
            {
                SetPlayerHoldingObject(playerid, 1210, 6,0.3,0.1,0,0,-90,0); // BriefCase
                SendClientMessage(playerid, COLOR_WHITE, " You have pulled out your briefcase. ");
                BCase[playerid] = 1;
                return 1;
            }
            else if(BCase[playerid] == 1)
            {
                 StopPlayerHoldingObject(playerid);
                 SendClientMessage(playerid, COLOR_WHITE, " You have put away your briefcase. ");
                 BCase[playerid] = 0;
                 return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, " You don't own a briefcase !");
            return 1;
        }
        return 1;
    }
    return 1;//Change this to 0 if it is your only command.
}
Hope that helped xD


Re: im looking for briefcase? - GBLTeam - 07.12.2010

Please help me!!

Код:
C:\Documents and Settings\GBLTeam\My Documents\My Received Files\LSLRP\LSLRP\gamemodes\lslrp.pwn(597) : error 021: symbol already defined: "BCase"
C:\Documents and Settings\GBLTeam\My Documents\My Received Files\LSLRP\LSLRP\gamemodes\lslrp.pwn(1719) : error 021: symbol already defined: "pBCase"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Line 597: new BCase[MAX_PLAYERS];//Defines if you have the briefcase putaway / Being used.
Line 1719: pBCase,

What i need to do to fix this??


Re: im looking for briefcase? - SkizzoTrick - 07.12.2010

The setplayerholdingobject its not working in 0.3c anymore


Re: im looking for briefcase? - GBLTeam - 07.12.2010

The setplayerholdingobject its not working in 0.3c anymore
im not using 0.3c im using 0.3b and i fix it thanks btw.