11.04.2014, 11:47
You can't do like that! Just do like this:
pawn Код:
CMD:weapons(playerid, params[])
{
static Float:_range, Float:posX, Float:posY, Float:posZ;
if(GetPlayerTeam(playerid) == 1) //red
{
_range = "-507.8125", posX = "2107.421875", posY = "-267.578125", posZ = "2316.40625";
}
else if(GetPlayerTeam(playerid) == 2) // blue
{
_range = "3.90625", posX = "1656.25", posY = "382.8125", posZ = "2121.0975";
}
else
{
SendClientMessage(playerid, -1, "You first choose a team and then you can try it again ;).");
}
if(IsPlayerInRangeOfPoint(playerid, _range, posX, posY, posZ))
{
ShowPlayerDialog(playerid, SHOP_DIALOG, DIALOG_STYLE_LIST, "Weapon Shop", "Deagle: $500\nSawn-Off: $1000\nM4: $2000\nSniper: $3000", "Select", "Exit");//Show them the dialog.
return true;
}
else
{
SendClientMessage(playerid, -1, "You must be at your own base to buy weapons.");
}
return true;
}