05.12.2010, 14:19
I see on some servers RPG there was to buy a BAG it was named /briefcase .. Can anyone give me that FS.
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.
}
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");
}
new BCase[MAX_PLAYERS];//Defines if you have the briefcase putaway / Being used.
pBCase,
BCase[playerid] = 0;//Sets the player to not have the briefcase out, when connecting.
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.
}
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.