CMD:beer(playerid, params[])
{
if(PlayerInfo[playerid][pBeer] >= 1)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
}
else
{
SendClientMessage(playerid,-1,"You don't have beer");
}
return true;
}
PlayerInfo[playerid][pBeer] = 0; //if player doesn't have any beer. Put this OnPlayerConnect callback
//////
//once he buys beer
PlayerInfo[playerid][pBeer]++;
///////
// once he uses command /beer
PlayerInfo[playerid][pBeer]--;
CMD:buybeer(playerid,params[]) { if(!IsPlayerInRangeOfPoint(playerid,4.0,x,y,z) return SendClientMessage(playerid,-1,"Samo comment if hi out of corrdinates");//put coordinates instead of x,y,z PlayerInfo[playerid][pBeer]++; GivePlayerMoney(playerid, -5);//Put how much money SendClientMessage(playerid,-1,"You bought beer"); return 1; }
This? Just put corrdinates for buy
Код:
CMD:buybeer(playerid,params[]) { if(!IsPlayerInRangeOfPoint(playerid,4.0,x,y,z) return SendClientMessage(playerid,-1,"Samo comment if hi out of corrdinates");//put coordinates instead of x,y,z PlayerInfo[playerid][pBeer]++; GivePlayerMoney(playerid, -5);//Put how much money SendClientMessage(playerid,-1,"You bought beer"); return 1; } |
This? Just put corrdinates for buy
Код:
CMD:buybeer(playerid,params[]) { if(!IsPlayerInRangeOfPoint(playerid,4.0,x,y,z) return SendClientMessage(playerid,-1,"Samo comment if hi out of corrdinates");//put coordinates instead of x,y,z PlayerInfo[playerid][pBeer]++; GivePlayerMoney(playerid, -5);//Put how much money SendClientMessage(playerid,-1,"You bought beer"); return 1; } |