Meal Easy Thing
#1

i made a cmd and i dont know how can i make it so if im at meal and i need to be in vehicle..

pawn Код:
if(strcmp(cmd, "/meal", true) == 0)
                    {
                        if(IsPlayerInVehicle(playerid))
                        {
                        if(IsAtMeal(playerid))
                        {
                        ShowPlayerDialog(playerid,Dialog_Meal,DIALOG_STYLE_LIST,"{278227}Meal","Cheese Burger\nSuc","Selecteaza","Inchide");
                        }
                        else
                        {
                        SendClientMessage(playerid, COLOR_GREY, " Nu esti la la Meal! !");
                        else
                        {
                        SendClientMessage(playerid, COLOR_GREY, " sdas !");
                        }
                        }
                    }
Reply
#2

pawn Код:
if(strcmp(cmd, "/meal", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsAtMeal(playerid))
            {
                ShowPlayerDialog(playerid,Dialog_Meal,DIALOG_STYLE_LIST,"{278227}Meal","Cheese Burger\nSuc","Selecteaza","Inchide");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, " Nu esti la la Meal! !");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, " sdas !");
        }
        return true;
    }
Reply
#3

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/meal", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsAtMeal(playerid))
            {
                ShowPlayerDialog(playerid,Dialog_Meal,DIALOG_STYLE_LIST,"{278227}Meal","Cheese Burger\nSuc","Selecteaza","Inchide");
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, " Nu esti la la Meal! !");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, " sdas !");
        }
        return true;
    }
thanks but i got a question. if i put like this how can i make the health to go up not down?
PHP код:
SetPlayerHealth(playeridhealth -5); 
i tried like this too
PHP код:
SetPlayerHealth(playeridhealth +5); 
Reply
#4

You may have defined the health float wrognly, make it like that:

pawn Код:
new Float: currenthp;
GetPlayerHealth(playerid, currenthp);
SetPlayerHealth(playerid, currenthp+5);
Reply
#5

PHP код:
if(GetPlayerHealth(playerid) > 100) { SendClientMessage(playeridCOLOR_RED"You ate too much!"); return 1; } 
i dont understand this..is it wrong or correct?
Reply
#6

pawn Код:
new Float: currenthp;
GetPlayerHealth(playerid, currenthp);
if(currenthp > 95) return SetPlayerHealth(playerid, 100);
if(currenthp == 100) return SendClientMessage(playerid, COLOR_RED, "You ate too much!");
SetPlayerHealth(playerid, currenthp+5);
Reply
#7

thanks its 05:38am in ROmania i cant think at this hour very well..thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)