enum [help]
#1

i was wonder how to make player to buy beer and to save to my enum pInfo-pBeer i make /beer cmd but i dont know to make make /buybeer i try few ways but dont set pBeer=1 and i was wonther how i can stack many beers at one like 6 beers at ones not only one so here my /beeer cmd

PHP код:
CMD:beer(playeridparams[])
{
    if(
PlayerInfo[playerid][pBeer] >= 1)
    {
         
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    }
    else
    {
        
SendClientMessage(playerid,-1,"You don't have beer");
    }
    return 
true;

Reply
#2

PHP код:
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]--; 
Reply
#3

hah thanks
Reply
#4

No Problem
Reply
#5

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;
}
Reply
#6

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
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;
}
Second post that you are coping things that I said. WHy?
Reply
#7

Quote:
Originally Posted by Gagi_Corleone
Посмотреть сообщение
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;
}
i dont need more help >>[MG]Dimi help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)