Meal Easy Thing - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Meal Easy Thing (
/showthread.php?tid=352228)
Meal Easy Thing -
Dan_Barocu - 19.06.2012
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 !");
}
}
}
Re: Meal Easy Thing -
zSuYaNw - 19.06.2012
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;
}
Re: Meal Easy Thing -
Dan_Barocu - 19.06.2012
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(playerid, health -5);
i tried like this too
PHP код:
SetPlayerHealth(playerid, health +5);
Re: Meal Easy Thing -
Randy More - 19.06.2012
You may have defined the health float wrognly, make it like that:
pawn Код:
new Float: currenthp;
GetPlayerHealth(playerid, currenthp);
SetPlayerHealth(playerid, currenthp+5);
Re: Meal Easy Thing -
Dan_Barocu - 19.06.2012
PHP код:
if(GetPlayerHealth(playerid) > 100) { SendClientMessage(playerid, COLOR_RED, "You ate too much!"); return 1; }
i dont understand this..is it wrong or correct?
Re: Meal Easy Thing -
Randy More - 19.06.2012
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);
Re: Meal Easy Thing -
Dan_Barocu - 19.06.2012
thanks its 05:38am in ROmania i cant think at this hour very well..thank you.