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 18/02/2020, 02:01 PM
Replies: 31
Views: 544
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: 544
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: 544
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: 60
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: 544
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,191,423
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: 229
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: 229
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: 88
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: 229
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: 70
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: 102
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: 5
Views: 134
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: 229
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: 52
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: 229
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: 226
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: 229
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: 226
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: 544
Posted By Calisthenics
Re: dialog doesn't show up

EOS = End Of String = '\0' = null character
Forum: Scripting Help 16/02/2020, 11:39 AM
Replies: 31
Views: 544
Posted By Calisthenics
Re: dialog doesn't show up

Just a variable.

// global:
new Player_MuteReason[MAX_PLAYERS][64];
// Player_MuteReason[playerid] to access
// 64 max length for reason

// command /mute
PlayerInfo[id][Muted] = calc;...
Forum: Scripting Help 16/02/2020, 10:47 AM
Replies: 31
Views: 544
Posted By Calisthenics
Re: dialog doesn't show up

You will have to store the reason in a global array/pvar in /mute(all) commands.
Forum: Scripting Help 16/02/2020, 10:45 AM
Replies: 3
Views: 79
Posted By Calisthenics
Re: Bug chat

How do you define Callback::X? If it is a define-pattern for public functions then `ProxDetector` is not the faulty function you are looking for.

Compile with debug info to get the exact line:...
Forum: Scripting Help 16/02/2020, 10:42 AM
Replies: 17
Views: 226
Posted By Calisthenics
Re: Error when die

Are the data in `point_muerte` array correct? I am not sure how any distance returned by `GetPlayerDistanceFromPoint` function will be greater than 99999.0 to fail the if statement but I can tell you...
Forum: Scripting Help 16/02/2020, 10:37 AM
Replies: 4
Views: 89
Posted By Calisthenics
Re: Problem with MySQL saving.

To add to what Unte99 said:
Use single quotes around strings only. This way, mysql will not have to internally convert text to integer or float.
You only need ` ` around columns when they are...
Showing results 1 to 25 of 500

 

All times are GMT. The time now is 06:23 AM.


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