SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 03/09/2012, 11:45 AM   #1751
airplanesimen
Huge Clucker
 
airplanesimen's Avatar
 
Join Date: Nov 2011
Location: Narvik, Norway
Posts: 429
Reputation: 21
Default Re: Little coding questions - For general minor queries 5

Edit: I did it wrong.
__________________

Get a cheap host here (click)
Check out our forums! --> www.ogs-forum.com
airplanesimen is online now   Reply With Quote
Old 03/09/2012, 02:10 PM   #1752
Westingham
Big Clucker
 
Join Date: Oct 2011
Posts: 50
Reputation: 1
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by [HLF]Southclaw View Post
The parameters of strfind are:
'string' = the string to search in
'sub' = the string you are searching for

So you have to just swap around the parameters:
pawn Code:
if(strfind(playerIP, searchIP) != -1)

Remember with strfind: the haystack comes before the needle.
Oh DERP. I see what I did wrong. Thanks!
Westingham is offline   Reply With Quote
Old 06/09/2012, 08:16 AM   #1753
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Location: pawno && htdocs
Posts: 1,667
Reputation: 114
Default Re: Little coding questions - For general minor queries 5

Did someone know id of road train horn soung id ? i only find for car horn
doreto is offline   Reply With Quote
Old 14/09/2012, 05:34 AM   #1754
ihatetn931
Gangsta
 
Join Date: Apr 2008
Posts: 614
Reputation: 6
Default Re: Little coding questions - For general minor queries 5

Anyone happen to know how i can make a checkpoint pickup a trailer instead of the player.

So if the trailer enters the checkpoint it does what it's suppose to , instead of having to enter it with the truck
__________________
ihatetn931 is offline   Reply With Quote
Old 19/09/2012, 02:36 PM   #1755
Devix
Big Clucker
 
Join Date: Jul 2012
Posts: 89
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

I want to make a command that creates a new file. The files will have numbers as titles. But, they should not overwrite eachother but just a new number Like: 1.ini, 2.ini 3.ini.
How can I create this using ini by y_less?
Devix is offline   Reply With Quote
Old 23/09/2012, 12:14 AM   #1756
SomeRandomGuy123
Little Clucker
 
Join Date: Sep 2009
Posts: 32
Reputation: 0
Default Re: Little coding questions - For general minor queries 5

How do I create text that the other player gets a message when a player types a command?
E.G: /pay, the sender recieves "You have sent money to %s" by SendClientMessage, but how does the reciever recieve text that they have been given money?
Thanks
SomeRandomGuy123 is offline   Reply With Quote
Old 23/09/2012, 11:54 AM   #1757
[HLF]Southclaw
High-roller
 
[HLF]Southclaw's Avatar
 
Join Date: Apr 2009
Location: England
Posts: 4,493
Reputation: 1028
Default Re: Little coding questions - For general minor queries 5

Use the same player ID variable you used in GivePlayerMoney.
[HLF]Southclaw is offline   Reply With Quote
Old 15/10/2012, 08:10 PM   #1758
Maniek
Huge Clucker
 
Maniek's Avatar
 
Join Date: Apr 2007
Posts: 337
Reputation: 2
Default Re: Little coding questions - For general minor queries 5

I want to use va_format to ShowPlayerDialogEx but I don't know why i have error "error 029: invalid expression, assumed zero".

PHP Code:
ShowPlayerDialogEx(playeriddialogidstylecaption[], format[], button1[], button2[], va_args<>)
{
    new 
out[128];
    
va_format(outsizeof(out), formatva_start<7>);
    
ShowPlayerDialog(playeriddialogidstylecaption[], outbutton1[], button2[]);


Last edited by Maniek; 16/10/2012 at 05:13 PM.
Maniek is offline   Reply With Quote
Old 16/10/2012, 04:29 AM   #1759
JhnzRep
Huge Clucker
 
JhnzRep's Avatar
 
Join Date: Jan 2012
Location: USA/Slovakia
Posts: 456
Reputation: 64
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Devix View Post
I want to make a command that creates a new file. The files will have numbers as titles. But, they should not overwrite eachother but just a new number Like: 1.ini, 2.ini 3.ini.
How can I create this using ini by y_less?
Use a loop, that then checks if the file exists.

PHP Code:
for(new 0i<MAX_FILESi++)
{
    new 
string[10];
    
format(string,sizeof(string), "/%i.ini"i);
    if(!
fexist)
    {
        break;
        
//code to create the file.
    
}

__________________
JhnzRep is offline   Reply With Quote
Old 17/10/2012, 03:46 PM   #1760
Anthony ©
Little Clucker
 
Join Date: Sep 2012
Posts: 49
Reputation: 4
Default Re: Little coding questions - For general minor queries 5

I want to gain knowledge of MySQL as I would like to eventually use it for account storage. With there being no current R7 guides, should I just use and follow a R6 based guide and then when my knowledge is wider, move onto R7. Not going to be hosting a server or using a MySQL database fully anytime soon, so it's just down to if it's a good path to take; to learn MySQL.

Thanks.
__________________
New at PAWN, don't hate on my newbiness!
Anthony © 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
how to make a soldier aotumaticly be general when the general dies ? AlbanianGuy Scripting Help 35 13/05/2012 03:35 PM
Minor problem Desert Help Archive 4 17/03/2010 06:24 PM
Counting with mysql queries actiwe Help Archive 2 26/02/2010 03:36 PM
SQL queries using GROUP BY Dabombber Help Archive 2 05/10/2009 07:47 PM


All times are GMT. The time now is 08:53 AM.


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