SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 02/11/2009, 03:16 PM   #511
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,429
Reputation: 13
Default Re: Useful Functions

Quote:
Originally Posted by <__Ǝthan__>
Quote:
Originally Posted by Y_Leѕѕ
I suggest you read this, it's not as simple as vowels and consonants:

"An hour is a unit of time"
"You are a high flier"
"An FBI agent"

Fortunately, you just need to define a few extra uses of "an", "a" is never used before vowels.

http://www.karlonia.com/2008/07/05/e...r-lesson-a-an/
-.- I do not need a grammar lesson, I made a simple function, I wasn't going to go trough all the trouble to add in all that. I made the function just for the use of vehicle names, if you do not like that, make your own function.
lol, he just suggest you to add some words to help you.. don't attack him
Luka P. is offline   Reply With Quote
Old 02/11/2009, 03:34 PM   #512
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,262
Reputation: 13
Default Re: Useful Functions

Quote:
Originally Posted by Luka™
Nice <__Ǝthan__> .
Did you create it?
It's very simple, but the idea is nice.
MenaceX^ is offline   Reply With Quote
Old 02/11/2009, 05:28 PM   #513
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 762
Reputation: 44
Default Re: Useful Functions

Quote:
Originally Posted by Luka™
Quote:
Originally Posted by <__Ǝthan__>
Quote:
Originally Posted by Y_Leѕѕ
I suggest you read this, it's not as simple as vowels and consonants:

"An hour is a unit of time"
"You are a high flier"
"An FBI agent"

Fortunately, you just need to define a few extra uses of "an", "a" is never used before vowels.

http://www.karlonia.com/2008/07/05/e...r-lesson-a-an/
-.- I do not need a grammar lesson, I made a simple function, I wasn't going to go trough all the trouble to add in all that. I made the function just for the use of vehicle names, if you do not like that, make your own function.
lol, he just suggest you to add some words to help you.. don't attack him
I didn't mean to attack him if that's what it sounds like D:
I had just woke up and was a little grumpy lol, sowwy if I was a little offensive.
__________________
StrickenKid is offline   Reply With Quote
Old 02/11/2009, 06:03 PM   #514
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,429
Reputation: 13
Default Re: Useful Functions

You're angry because he gave you link that contains "english-grammar-lesson-a-an" ? :P
Luka P. is offline   Reply With Quote
Old 02/11/2009, 06:30 PM   #515
Lia
Little Clucker
 
Join Date: Sep 2009
Posts: 29
Reputation: 0
Default Re: Useful Functions

How would /getip work..? :/
Lia is offline   Reply With Quote
Old 03/11/2009, 04:41 AM   #516
StrickenKid
Gangsta
 
Join Date: Feb 2009
Posts: 762
Reputation: 44
Default Re: Useful Functions

beep - make console beep

Good for pointing out things when debuging maybe?

pawn Code:
stock beep(times = 1)
{
    new
        beepstr[128];
    format(beepstr, sizeof(beepstr), "[beep] console beeped %i times", times);
    for(new i = 0; i < times; i++)
    {
        strcat(beepstr, "\a", sizeof(beepstr));
    }
    return print(beepstr);
}
__________________
StrickenKid is offline   Reply With Quote
Old 03/11/2009, 04:40 PM   #517
MenaceX^
High-roller
 
Join Date: Aug 2008
Posts: 3,262
Reputation: 13
Default Re: Useful Functions

Quote:
Originally Posted by Lia
How would /getip work..? :/
And that is related how?
MenaceX^ is offline   Reply With Quote
Old 05/11/2009, 02:30 PM   #518
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,429
Reputation: 13
Default Re: Useful Functions

pawn Code:
#define pClass(%1) GetPlayerSkin(playerid)==%1
I needed this.
You don't need anymore
pawn Code:
new plClass = GetPlayerSkin(playerid);
if(plClass == 100 || plClass == 200 || plClass == 300)
Now you can use
pawn Code:
if(pClass(100) || pClass(200) || pClass(300))
{
}

It is not so useful , but if you want to use it, go ahead
Luka P. is offline   Reply With Quote
Old 05/11/2009, 04:24 PM   #519
Luka P.
High-roller
 
Join Date: Feb 2009
Posts: 1,429
Reputation: 13
Default Re: Useful Functions

Quote:
Originally Posted by Y_Leѕѕ
You just basically tripled the time that code takes to run!

Also:

pawn Code:
if (!pClass(100))

Try that code, I know, and I suspect you know, what people THINK it should do, but try it. Also, slightly more arbitrary, but still possible, bits of code with unexpected results due to bad macro composition:

pawn Code:
if (pClass(a == 10 ? 100 : 101))

pawn Code:
if (pClass(100) & 0x21)

Think what you would expect from those bits of code, then see what you really get.
I made that macro for myself (not for this forum), not gonna use that code what you write.
I'm just using
pawn Code:
if(pClass(100) || pClass(200) || pClass(300))
{
    SendClientMsg...
    gTeam...
Luka P. is offline   Reply With Quote
Old 05/11/2009, 05:03 PM   #520
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 2,818
Reputation: 650
Default Re: Useful Functions

Actually ****** wanted to help you to improve your macro (indirectly)...
Nero_3D is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] [INC] LSF - Lorenc's Simple Functions (w/ gang/clan functions) Lorenc_ Includes 14 21/04/2018 04:06 AM
Functions? sciman001 Help Archive 7 19/03/2011 03:03 PM
How to get functions? Twain32 Help Archive 4 08/10/2010 07:37 PM
[Include] [INC] SA:MP New Functions 0.4a DKN ipsBruno Lançamentos/Releases 22 17/06/2010 08:38 AM
What this functions do? harrold Help Archive 2 08/05/2009 11:30 PM


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.