SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/03/2019, 11:13 AM   #4111
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,513
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

Is there a good e-mail plugin for SA-MP or is there possibility to use a Python script in a plugin for SA-MP server?
Logic_ is offline   Reply With Quote
Old 13/03/2019, 03:31 PM   #4112
justinnater
Huge Clucker
 
justinnater's Avatar
 
Join Date: Jan 2011
Posts: 249
Reputation: 85
Default Re: Little coding questions - For general minor queries 5

I've been working on a script and throughout this process I have 3 questions on my mind...

How would you create your own function that returns multiple variables and stores them inside the function caller?
For example, GetPlayerPos(playerid, x, y, z);

How can you create a function that accepts multiple and different types parameters?
For instance, the function can be called with the first 2 parameters being a float, but there can be situations where it is 6 parameters and them all being a string or integer only. Like this
Code:
testfunction("si", "test", 1.0);
Is there, or is it possible to create a function that triggers functions? CallRemoteFunction triggers callbacks but not functions, which is unfortunate....
justinnater is offline   Reply With Quote
Old 13/03/2019, 03:49 PM   #4113
Kaliber
High-roller
 
Kaliber's Avatar
 
Join Date: Jun 2012
Location: Localhost
Posts: 1,091
Reputation: 156
Default Re: Little coding questions - For general minor queries 5

You can trigger functions with CallRemoteFunction/CallLocalFunction, they just must be public, but you can create them.

You can even make dynamic function headers: https://wiki.sa-mp.com/wiki/Getarg

the old sscanf function for example uses this https://wiki.sa-mp.com/wiki/Sscanf_code

But if you want specific help or something, ask more specific or give an direct example pls
__________________
Kaliber is offline   Reply With Quote
Old 13/03/2019, 04:01 PM   #4114
justinnater
Huge Clucker
 
justinnater's Avatar
 
Join Date: Jan 2011
Posts: 249
Reputation: 85
Default Re: Little coding questions - For general minor queries 5

Thanks, that helps me a lot! Although for the CallRemoteFunction, I know it can trigger public functions, but I was hoping there would be a way to trigger native functions like CallNativeFunction("print", "s", "hello world");
justinnater is offline   Reply With Quote
Old 13/03/2019, 06:30 PM   #4115
justinnater
Huge Clucker
 
justinnater's Avatar
 
Join Date: Jan 2011
Posts: 249
Reputation: 85
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by Logic_ View Post
Is there a good e-mail plugin for SA-MP or is there possibility to use a Python script in a plugin for SA-MP server?
You could also create a Python script on a web server and post a HTTP request to it.
justinnater is offline   Reply With Quote
Old 17/03/2019, 08:15 PM   #4116
v4yne1
Little Clucker
 
Join Date: Feb 2019
Posts: 30
Reputation: 4
Default Re: Little coding questions - For general minor queries 5

this might not be the place to ask for this but..

i need the name of the system that tells me names of different parts of los santos.

for example, im on vinewood - textdraw says 'GPS: Vinewood'
v4yne1 is offline   Reply With Quote
Old 17/03/2019, 08:16 PM   #4117
SymonClash
Banned
 
Join Date: Dec 2018
Posts: 254
Reputation: 25
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by v4yne1 View Post
this might not be the place to ask for this but..

i need the name of the system that tells me names of different parts of los santos.

for example, im on vinewood - textdraw says 'GPS: Vinewood'
That's Zones include.
SymonClash is offline   Reply With Quote
Old 17/03/2019, 08:19 PM   #4118
v4yne1
Little Clucker
 
Join Date: Feb 2019
Posts: 30
Reputation: 4
Default Re: Little coding questions - For general minor queries 5

Quote:
Originally Posted by SymonClash View Post
That's Zones include.
holy moly man you are fast

thanks a lot
v4yne1 is offline   Reply With Quote
Old 23/03/2019, 04:11 PM   #4119
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,513
Reputation: 305
Default Re: Little coding questions - For general minor queries 5

REMOVED

Last edited by Logic_; 29/03/2019 at 02:31 PM.
Logic_ is offline   Reply With Quote
Old 09/04/2019, 02:36 AM   #4120
Ermanhaut
Gangsta
 
Ermanhaut's Avatar
 
Join Date: Apr 2016
Location: Brazil
Posts: 657
Reputation: 47
Default Re: Little coding questions - For general minor queries 5

Reading a few topics about optimization i've found 'Char-arrays':
pawn Code:
new playerName[MAX_PLAYERS char][MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName{playerid}, MAX_PLAYER_NAME);
printf("%s", playerName{playerid});

The code above would be right according to this topic but pawn-lang compiler rejects it.

Is there any mistakes in my code or is there something else i have to do to use Char-arrays?
__________________
try, try and try again
Ermanhaut 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 02:36 PM
SQL queries using GROUP BY Dabombber Help Archive 1 05/10/2009 07:47 PM


All times are GMT. The time now is 09:59 PM.


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