06.12.2010, 01:20
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.
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
Top of Script.
Under, pInfo(If using GF / Edit of GF)
Under, OnPlayerConnect
Hope that helped xD
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.
}
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");
}
pawn Код:
new BCase[MAX_PLAYERS];//Defines if you have the briefcase putaway / Being used.
pawn Код:
pBCase,
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.
}