15.06.2014, 14:23
PHP код:
CMD:accept(playerid,params[])
{
new name[12];
if(sscanf(params,"s",name))return SCM(playerid,-1,"Введите /accept [name]");
if(strmid(name,"biz",0,4,sizeof(name))&&GetPVarInt(playerid,"Bizness") >0)
{
Player[playerid][Bizness] = GetPVarInt(playerid,"Bizness");
if(Player[playerid][Money] < GetPVarInt(playerid,"Cash"))return SCM(playerid,-1,"У вас недостаточно денег.");
Player[playerid][Money] -= GetPVarInt(playerid,"Cash");
Player[GetPVarInt(playerid,"bID")][Bizness] = 0;
Player[playerid][Bizness] = 1;
SendFormatedMessage(GetPVarInt(playerid,"bID"),-1,"Вы продали свой бизнесс %s за %d",Player[playerid][Nick],GetPVarInt(playerid,"Cash"));
Player[GetPVarInt(playerid,"bID")][Money] += GetPVarInt(playerid,"Cash");
if(GetPVarInt(playerid,"Bizness") == 1) format(AmmoShop[1][Owner],24,"%s",Player[playerid][Nick]);
SetPVarInt(playerid,"Cash",0);
SetPVarInt(playerid,"bID",0);
SetPVarInt(playerid,"Bizness",0);
}
return true;
}