Author Topic: Calling function by text  (Read 4410 times)

0 Members and 1 Guest are viewing this topic.

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Calling function by text
« on: November 13, 2012, 10:11:23 am »
Hey there! This is my small tutorial on how to call functions by text
Note: Using this players on your server will call functions by text, not using /c cmdtext

So
All you need is:
1st. Change public OnPlayerText To this view: OnPlayerText(playerid, text[])
now, i will show you how does it work:

[pawn]public OnPlayerText(playerid, text[])
{
   if(strcmp(text, "Gimme gren please", true)==0)
   {
        SetPlayerWeapon(playerid, 12, 3);
        SendClientMessage(playerid, 0xFF0000AA, "Waiter: your welcome!");
        return 1;
   }
   return 0;
}[/pawn]

with this example players can get 3 grenades saying, "Gimme gren please"  :P


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Re: Calling function by text
« Reply #1 on: November 13, 2012, 07:12:41 pm »
I wouldn't really call this a tutorial. I think this should be in the Snippet's Section.
I'm beginning to feel like a Lag God, Lag God

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Calling function by text
« Reply #2 on: November 13, 2012, 10:15:43 pm »
I think you're right.  :-\


-Funniest quotes-

Quote from: asad3man
i cant able to understand

Offline dynavolt71

  • Crime Boss
  • ****
  • Posts: 371
    • View Profile
    • My Blog
Re: Calling function by text
« Reply #3 on: November 15, 2012, 07:31:53 am »
:O nice one
[PAWNO]Fix Error " Failed to set data for "" " - http://forum.vicecitymultiplayer.com/index.php?topic=5743.0



:'(

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Calling function by text
« Reply #4 on: November 16, 2012, 02:44:07 am »
This would be considered a tutorial, though very short, so it will stay here.
Do not PM me for support.