SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 25 of 500
Search took 0.03 seconds.
Search: Posts Made By: Calisthenics
Forum: Scripting Help 20/02/2020, 01:42 PM
Replies: 9
Views: 162
Posted By Calisthenics
Re: on login, reaching final (3rd) attempt, typing correct password, getting kicked..

Failed attempts should not be separated. If it still does not work, print `PlayerInfo[playerid][Password]` and make sure they are identical with the output of `hashpass`.

case DIALOG_LOGIN:
{
...
Forum: Scripting Help 20/02/2020, 11:53 AM
Replies: 2
Views: 67
Posted By Calisthenics
Re: Wont update query

If `PI[id][ID]` is 0 (not set with `cache_insert_id` function when registering for example), the query will be executed but 0 rows will be affected.

You can debug it after formatting to make sure:...
Forum: Scripting Help 19/02/2020, 07:07 AM
Replies: 2
Views: 89
Posted By Calisthenics
Re: Problem with saving after some hours

If you save everything every minute, the number of open files limit might be reached.
Forum: Scripting Help 19/02/2020, 06:55 AM
Replies: 3
Views: 95
Posted By Calisthenics
Re: Bug on load Buisness.

Row ID starts from 0 so 0 to 9 is correct when fetching data. On the other hand, identifiers with auto increment start from 1 but this does not mean array index must be equal to sql identifier.
...
Forum: Includes 19/02/2020, 06:46 AM
Replies: 23
[Include] GeoLite
Views: 5,270
Posted By Calisthenics
Re: GeoLite

Thank you, I appreciate it.
Forum: Scripting Help 18/02/2020, 02:01 PM
Replies: 31
Views: 591
Posted By Calisthenics
Re: dialog doesn't show up

It is not difficult if you see how you save/load other data. All you have to know is the correct datatype (string, integer, float etc.) and which variables store the data.

An example:

// when...
Forum: Scripting Help 18/02/2020, 01:29 PM
Replies: 31
Views: 591
Posted By Calisthenics
Re: dialog doesn't show up

Data stored in variables are lost when server shuts down. This is why we store data in database/files.

If you want to re-mute players automatically upon re-joining, you will have to save the...
Forum: Scripting Help 18/02/2020, 01:02 PM
Replies: 31
Views: 591
Posted By Calisthenics
Re: dialog doesn't show up

These two commands look OK. Did you perhaps use /muteall and did not assign a reason in that command so the reason is empty in mute list?

A recommendation: Most command processors have callback...
Forum: Scripting Help 18/02/2020, 10:48 AM
Replies: 2
Views: 71
Posted By Calisthenics
Re: Invalid Dataype - Help Please

What version of the plugin do you use? Try updating to R39-6 (https://github.com/pBlueG/SA-MP-MySQL/releases/tag/R39-6) which displays query on errors/warnings in some places. If datatype error is...
Forum: Scripting Help 18/02/2020, 09:01 AM
Replies: 31
Views: 591
Posted By Calisthenics
Re: dialog doesn't show up

Can you post /mute and /mutelist commands?
Forum: Plugin Development 17/02/2020, 12:46 PM
Replies: 5,545
[Plugin] Streamer Plugin
Views: 3,194,955
Posted By Calisthenics
Re: Streamer Plugin

Plugin version and include version do not match.
Forum: Scripting Help 17/02/2020, 11:34 AM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

On second thought, converting to an integer is just extra work. Working with float is easier:

CalculateDistance(Float: distance)
{
new str[13];

if (distance >= 1000.0)
{
...
Forum: Scripting Help 17/02/2020, 10:52 AM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

https://wiki.sa-mp.com/wiki/Function:floatround

First parameter is what `GetPlayerDistanceFromPoint` returns.
Forum: Scripting Help 17/02/2020, 10:50 AM
Replies: 2
Views: 102
Posted By Calisthenics
Re: Replace char mysql \n

\n character can be inserted and retrieved correctly to/from database.

The mistake is the missing single quotes around string specifiers:
transacciones=%s should be transacciones='%s'
But you...
Forum: Scripting Help 17/02/2020, 10:47 AM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

`GetPlayerDistanceFromPoint` returns float and the input of `CalculateDistance` is integer.
Forum: Scripting Help 17/02/2020, 10:34 AM
Replies: 2
Views: 78
Posted By Calisthenics
Re: Auto save data, problem

The warning was given by sscanf, might be on loading (and splitting) or unrelated to the code above.

There is another issue and that is saving multiple values in one column. This is wrong design...
Forum: Scripting Help 17/02/2020, 10:31 AM
Replies: 7
Views: 118
Posted By Calisthenics
Re: ReturnIP issue

May I suggest you two miscellaneous functions:

IP (as text) to integer: https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_inet-aton
IP (as integer) to text:...
Forum: Scripting Help 17/02/2020, 10:27 AM
Replies: 6
Views: 186
Posted By Calisthenics
Re: MySQL optimization

Database normalization and correct use of indexes.

https://en.wikipedia.org/wiki/Database_normalization#Normal_forms
https://www.guru99.com/database-normalization.html
...
Forum: Scripting Help 17/02/2020, 10:24 AM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

@jasperschellekens: input is in meters so multiplying with 1000 will give different result.

Diving with 1000 only for distance such as 1736 meters, it will display 1 km. If you want more precision...
Forum: Scripting Help 16/02/2020, 09:18 PM
Replies: 3
Views: 60
Posted By Calisthenics
Re: Multiparam Command

If the option given is "engine", each `if` statement will be checked (3 checks). It is unnecessary, so use `else if` to check only once.
Forum: Scripting Help 16/02/2020, 08:29 PM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

- Format the distance and the correct metric unit to return the string directly from the function
- Pass-by-reference the output
- Pass-by-reference the distance and the correct metric unit to...
Forum: Scripting Help 16/02/2020, 07:56 PM
Replies: 17
Views: 244
Posted By Calisthenics
Re: Error when die

Not using any class and calling `SpawnPlayer` or exiting from spectating mode which automatically re-spawns the player may give the boundaries error and loading bug.
...
Forum: Scripting Help 16/02/2020, 07:53 PM
Replies: 20
Views: 257
Posted By Calisthenics
Re: Kilometers/meters conversion

DisplayDistance(distance)
{
if (distance >= 1000)
{
// display "km"
// km = distance / 1000
}
else
{
// display "meters"
Forum: Scripting Help 16/02/2020, 04:30 PM
Replies: 17
Views: 244
Posted By Calisthenics
Re: Error when die

Do you have at least one class in server (using `AddPlayerClass` function)? If not, you should add one in `OnGameModeInit` callback.

Your array has a duplicate, it does not use the first index for...
Forum: Scripting Help 16/02/2020, 12:00 PM
Replies: 31
Views: 591
Posted By Calisthenics
Re: dialog doesn't show up

EOS = End Of String = '\0' = null character
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 03:41 AM.


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