After minding progress up I made "Restaurant on the run"
All u need:
change public
OnPlayerText to the next:
public
OnPlayerText(playerid, text[])[pawn]{
if (strcmp(text, "Caesar salad please", true)==0 && GetPlayerMoney(playerid) >=100)
{
SendClientMessage(playerid, 0xFF0000AA, "Waiter: Here your salad, sir. Bon appetite!");
SetPlayerHealth(playerid, 100);
SetPlayerMoney(playerid, GetPlayerMoney(playerid)-100);
SendClientMessage(playerid, 0xFF0000AA, "You got paid $100 for salad!");
return 1;
}
else if(strcmp(text, "Caesar salad pls!", true)==0 && GetPlayerMoney(playerid) <=99)
{
SendClientMessage(playerid, 0xFF0000AA, "Sorry, but we do not feed the homeless. Go work sir! This salad costs $ 100.");
return 1;
}
return 1;
}[/pawn]
Now, saying "Caesar salad please" you will restore your health
P.S. This is an example of text which can apply functions.