Fixing Bugs?
#1

I'm a noob in Pawno,
And I came to a question that. How do you fix script bugs?!?! For example you type a cmd and it doesn't make anything. I'm not asking you to put codes...etc in general what do you do? Rewrite,recompile...?
Reply
#2

You need to fix the command you created, if you don't know how then you'd make a topic on here regarding the question as to why it won't work.
Reply
#3

That's my question " fix " what do you do? Rewrite the command?
Reply
#4

Quote:
Originally Posted by Fadel
Посмотреть сообщение
That's my question " fix " what do you do? Rewrite the command?
Yes, rewrite the part that's bugged.
Reply
#5

Example:

I made a hotel system where players can rent rooms.
They pay rent every hour and the owner of the hotel can suspend their rooms, check the incomes, modify spendings, etc.

What didn't work the first time was loading the hotel rooms.

What I usually do is I first check if it was a silly mistake (I typ too quick :/) and if not, I add Print("one"), Print("two") etc to the different sections of the loading/command.

Once the print stops, you know something is wrong
Reply
#6

Then if I cut and paste the whole command it will be fixed?Since you rewrite it, or bugged means some codes are removed ?
Reply
#7

Ok, thats it, you rewrite the bugged part, but how to know the bogged part location?
Reply
#8

This is too much of a common question to be answered, it depends on what are you using to create the CMD (ZCMD, DCMD, strcmp)
Also, depends on what you are doing in that CMD...from changing variables to stable functions...
as I said, too common to be answered.
Reply
#9

Quote:
Originally Posted by Fadel
Посмотреть сообщение
Ok, thats it, you rewrite the bugged part, but how to know the bogged part location?
https://sampwiki.blast.hk/wiki/Debugging

or just rewrite the whole command. It shouldn't take you long.
Reply
#10

Okay bro, There's a simple format in errors:

Take this for example:

C:\Users\ADMIN\Desktop\Gangwars\gamemodes\US.pwn(3 206) : warning 217: loose indentation
LOCATION/LOCATION/LOCATION/LOCATION/LOCATION(LINENUMBER): warning TYPE

You just gotta fix that very line.


For more info on fixing these kinda errors: https://sampforum.blast.hk/showthread.php?tid=274028


And for scripting bugs but NOT pawn compiler bugs:

You scripted it wrong. Double check your code for bugs before posting it on the SAMP forums. Most of the time we just make a minor mistake by putting a wrong code line. You don't need to rewrite the whole command/code just for a little error.

For example:

You're making a dialog using switch

and heres your code:
pawn Код:
switch (dialogid)
    {
        case 1:
        {
             if(response)
             {
                 BLAHBLAHBLAHBLAHBLAHBLAH  
              }
         }
    }
And you open up your dialog but it doesn't respond. The only mistake here would be that PAWNO's numbers start from 0 instead of 1. You change case 1 to case 0 and Voila! It works fine.


Some minor errors, that's it. Just re-check your code, make sure you did everything right, and if still you can't, try to re-write it, and if still not, post it on SAMP forums.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)