16.10.2011, 15:20
pawn Code:
if (strcmp("/getguns", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 866.7318,-2140.3936,13.2975))
{
if(PlayerInfo[playerid][pFMember] == 1)
{
ShowPlayerDialog(playerid, 987, DIALOG_STYLE_LIST, "Gang Guns", "Choose a Gun you want", "M4($3000)\nAK-47($3000)\nMP5($2500)\nSniper($5000)\nRocket Luncher($10000)", "Buy", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your not a member of The Gang");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your not near the Armory");
}
return 1;
}
if (strcmp("/spadegate", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 820.59997559,-2068.19995117,11.89999962))
{
if(PlayerInfo[playerid][pFMember] == 1)
{
if(SpadeOpen == 1)
{
MoveObject(SpadeGate, 820.59997559,-2068.19995117,11.89999962, 3.0);
SpadeOpen = 0;
}
else if(SpadeOpen == 0)
{
MoveObject(SpadeGate, 829.09997559,-2068.19995117,11.89999962, 3.0);
SpadeOpen = 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your not a member of the gang");
}
}
else
{
SendClientMessage(playerid, COLOR_GREy, "Your not near the Gate");
}
return 1;
}
pawn Code:
if(dialogid == 987)
{
if(response)
{
switch(listitem)
{
new string[128];
case 1: // M4
{
if(PlayerInfo[playerid][pCash] >= 3000)
{
GivePlayerWeapon(playerid, 31, 999999);
SendClientMessage(playerid, COLOR_GREY, "You have bought a M4");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 3000;
format(string, sizeof(string), "%s has bought a M4 At the Gang armory", RemoveUnderScore(playerid));
SendFamilyMessage(1, COLOR_DBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You dont have enought money to buy that");
}
}
case 2: // Ak
{
if(PlayerInfo[playerid][pCash] >= 3000)
{
GivePlayerWeapon(playerid, 30, 999999);
SendClientMessage(playerid, COLOR_GREY, "You have bought a AK-47");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 3000;
format(string, sizeof(string), "%s has bought a AK-47 At the Gang armory", RemoveUnderScore(playerid));
SendFamilyMessage(1, COLOR_DBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You dont have enought money to buy that");
}
}
case 3: // MP5
{
if(PlayerInfo[playerid][pCash] >= 2500)
{
GivePlayerWeapon(playerid, 29, 999999);
SendClientMessage(playerid, COLOR_GREY, "You have bought a MP5");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 2500;
format(string, sizeof(string), "%s has bought a MP5 At the Gang armory", RemoveUnderScore(playerid));
SendFamilyMessage(1, COLOR_DBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You dont have enought money to buy that");
}
}
case 4: // Sniper
{
if(PlayerInfo[playerid][pCash] >= 5000)
{
GivePlayerWeapon(playerid, 34, 999999);
SendClientMessage(playerid, COLOR_GREY, "You have bought a Sniper");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 5000;
format(string, sizeof(string), "%s has bought a Sniper At the Gang armory", RemoveUnderScore(playerid));
SendFamilyMessage(1, COLOR_DBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You dont have enought money to buy that");
}
}
case 5: // Rocket Luncher
{
if(PlayerInfo[playerid][pCash] >= 10000)
{
GivePlayerWeapon(playerid, 35, 999999);
SendClientMessage(playerid, COLOR_GREY, "You have bought a Rocket Luncher");
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 10000;
format(string, sizeof(string), "%s has bought a Rocket Luncher At the Gang armory", RemoveUnderScore(playerid));
SendFamilyMessage(1, COLOR_DBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You dont have enought money to buy that");
}
}
}
}
}
EDIT:
nvm.