[FilterScript] [MySQL - R41]: Dynamic teleports system - FixFl0w
#1

Hello, this system has the following commands.

/createteleport [name] - create a teleport.
/teleport [name] - you teleport to a teleport.
/teleports - list of all available teleports.
/deleteteleport (Admin rcon) - You delete a teleport.

Then I will leave some images of this.




Pastebin: https://pastebin.com/KChBjwBF

FixFl0w.

Sorry my language is Spanish, but that section was deleted, sad

Solved
Reply
#2

Ok, I've noticed a lot of mistakes on the script, but I will keep it short.

- The identation is killed, that really hurts my eyes.
- Spanish language? Why not translate it to english and then release it?
- new telexd[12]; 12? What if the teleport name is "iwanttogothereplease" higher than 12 characters? Increase that.

This:
PHP Code:
new Float:XXD,Float:YXD,Float:ZXD
Could be done like this:
PHP Code:
new FloatPosition[3]; 
Then:
PHP Code:
GetPlayerPos(playerid,XXD,YXD,ZXD); 
To:
PHP Code:
GetPlayerPos(playerid,Position[0], Position[1], Position[2]); 
This:
PHP Code:
('%s','%f','%f','%f','%d','%s')",nombretele,XXD,YXD,ZXD,interiorXD,Nombre(playerid)); 
To:
PHP Code:
('%s','%f','%d','%s')",nombretele,Position[3],interiorXD,Nombre(playerid)); 
Also why are you using %s and not %e to escape strings instead? It's an updated version of MySQL!

It's pretty shitty sorry to say, but please improve your code.


And, one more thing!

Do you even compile your code before releasing?!

PHP Code:
#include <a_samp>
#include <a_mysql>
#include <zcmd> 
PHP Code:
if(sscanf(params,"s[12]",telexd)) return SendClientMessage(playerid,-1,"*Use: /teleport [name]"); 
You use sscanf on a command, but it's not compiled on the script? Is this copy-pasted from someone else?


PHP Code:
error 010invalid function or declaration
error 017
undefined symbol "Database"
error 017undefined symbol "sscanf"
error 017undefined symbol "Nombre"
error 017undefined symbol "SIN_USO"
warning 204symbol is assigned a value that is never used"R"
error 017undefined symbol "sscanf"
error 017undefined symbol "sscanf"
error 017undefined symbol "DIALOGO_TELESXD"
error 017undefined symbol "DIALOGO_TELESXD"
error 017undefined symbol "DIALOGO_TELESXD"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
10 Errors

Lol! You don't even know what you're doing bud!
Reply
#3

Rays, I was wrong, in the transfer of the gamemode to pastebin. thanks, I'll solve it
Reply
#4

What do you mean? Did you just copy-paste it from a gamemode to pastebin?
Reply
#5

The system of course I did it, but it was a serious mistake of mine not to compile it, I had it already days ago, thanks for the help, the pastebin, will be updated.
Reply
#6

Yeah and that's not the only mistake, read out carefully what I wrote, don't just ignore everything.
Reply
#7

I did it, and I took your recommendations into account, thank you very much.
Reply
#8

k verguensa you give me fix and you call scripter ?, please still do not know how to optimize a simple code? ... Take Those tips that are giving you! .. and learn that your vastete criticized me but now look at how things change. .. PS: I'm an old friend
Reply
#9

Quote:
Originally Posted by Marshmello
View Post
k verguensa you give me fix and you call scripter ?, please still do not know how to optimize a simple code? ... Take Those tips that are giving you! .. and learn that your vastete criticized me but now look at how things change. .. PS: I'm an old friend
First of all, I will not discuss with a gm's editor, and second, the
problems have been solved, of course I took into account the comments of willbedie, or I would not have noticed such serious errors ..

PD: I left this for quite some time, I forgot several things, that's why I made mistakes and I never considered you my friend. goodbye
Reply
#10

Quote:
Originally Posted by willbedie
View Post
- The identation is killed, that really hurts my eyes.
Exactly my first impression also. I was like "ooh! dynamic teleport system.. GUD! mysql.. GUD! dialog based.. GUD! ..... uh oh, nevermind"
Reply
#11

The idea is good, but the code has errors...

- In the first line the comment is missing a /.
- In the line 73 you load the interior but it does not set the interior for the player.
- In the /deleteteleport command you should verify if the teleport exists.

Other things..

Код:
new enum {
SIN_USO,
DIALOG_TELESXD,
}
Why don't you use 0 instead of SIN_USO?
Why don't you define the dialog id with #define?

Код:
stock Nombre(playerid){
new namek[24];
GetPlayerName(playerid,namek,sizeof(namek));
return namek;}
You do not need to create a stock to use it once.

And.. the identation..


Ame los nombres de las variables
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)