19.05.2011, 10:31
pawn Код:
if(armshop[playerid]==1)
{
if(IsPlayerConnected(GetPVarInt(playerid, "arm1")) && GetPVarType(playerid, "arm1") != 0)
{
switch(strval(text))
{
case 1:
{
GivePlayerMoney(GetPVarInt(playerid, "arm1"), 2000);
format(string,sizeof(string),"You have sold an M4 with 500 Ammo to %s(%d) for $2000!",pname,(playerid));
SendClientMessage(GetPVarInt(playerid, "arm1"),COLOR_LIGHTBLUE,string);
DeletePVar(playerid, "arm1");
GivePlayerWeapon(playerid,31,500);
GivePlayerMoney(playerid,-2000);
}
case 2:
{
GivePlayerMoney(GetPVarInt(playerid, "arm1"), 1000);
format(string,sizeof(string),"You have sold a Shotgun with 500 Ammo to %s(%d) for $1000!",pname,(playerid));
SendClientMessage(GetPVarInt(playerid, "arm1"),COLOR_LIGHTBLUE,string);
DeletePVar(playerid, "arm1");
GivePlayerWeapon(playerid,31,500);
GivePlayerMoney(playerid,-1000);
}
}
}
armshop[playerid]=0;
TextDrawHideForPlayer(playerid,TextDraw4);
return 0;
}