Vice City Multiplayer

General Discussion => Support => Tutorials => Topic started by: NeskWriter on November 13, 2012, 10:11:23 am

Title: Calling function by text
Post by: NeskWriter 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
(http://image.ph/images/2012/11/13/Ynz4.jpg)
Title: Re: Calling function by text
Post by: Fuzzy168 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.
Title: Re: Calling function by text
Post by: NeskWriter on November 13, 2012, 10:15:43 pm
I think you're right.  :-\
Title: Re: Calling function by text
Post by: dynavolt71 on November 15, 2012, 07:31:53 am
:O nice one
Title: Re: Calling function by text
Post by: stormeus on November 16, 2012, 02:44:07 am
This would be considered a tutorial, though very short, so it will stay here.