Scripting for Beginner - Tips
#1

Hello, I'm hoping to start scripting... I want to learn but I'm not sure exactly where to start. It all looks like a lot right now. Any advice or help?
Reply
#2

i can help you now , you have ********?
Reply
#3

You can read the sa-mp wiki by clicking on the following link: https://sampwiki.blast.hk/, everything you need to know about pawn is there.

Also keep in mind that creativity is all you need to be a great scripting.

I'll suggest you to use zcmd and sscanf to code commands as its really easy and kinda fun also:

Example:

pawn Код:
CMD:heal(playerid, params[])
{
    new string[128], lookupid, pname[25], name[25];
    if(sscanf(params, "ui", lookupid))
    {
        format(string, sizeof (string), "* Usage: /heal (id/name).");
        SendClientMessage(playerid, 0xFFFF00FF, string);
        return 1;
    }
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(lookupid, name, sizeof(name));
    SetPlayerHealth(lookupid, 100);
    format(string, sizeof (string), "* You've healed %s (%d)!", name, lookupid);
    SendClientMessage(playerid, 0xFFFF00FF, string);
    format(string, sizeof (string), "* %s (%d) has healed you!", pname, playerid);
    SendClientMessage(lookupid, 0xFFFF00FF, string);
    return 1;
}
SSCANF: https://sampforum.blast.hk/showthread.php?tid=120356.
ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354.

Good luck!
Reply
#4

First of all, I suggest you to go to wiki.sa-mp.com and read function topics to learn them. Also, there are tutorials for the most simple command as /heal etc. Also look at script examples for begginers... I started doing that an year ago and now I'm creating my RP server.
Reply
#5

Download some filterscripts or gamemodes and learn from observing.
Experiment when you learned something, try to make it yourself and try to edit it.
Read through the samp wiki if you can't figure something out.

And for your mental motivation read this topic:
https://sampforum.blast.hk/showthread.php?tid=496018

Good luck! The beginning is hard but it gets easier along the way.
Reply
#6

So, you wanna learn pawn? Brilliant, it's a good language and you will have fun when you see your projects in action. I'm gonna give you a few tips.

1) Pawno(cc) is not a language, it's a compiler
2) A compiler is a program that turns code that we understand, into code that the computer understands
3) You can use different pawn editors, the default one is pawno.exe in your Pawn folder
4) Pawn is the coding language, .pwn the file and .amx the complied file.
5) Don't start things you know you can't finish
6) Don't try to start learning from other scripts
7) Have fun when coding


To start learning, I highly recommend looking through tutorial on the SA-MP forums. When you have finished reading some tutorials, try to script something. When you come into errors, search for the solution on the SA-MP Wiki and try to fix it yourself. If you learn to fix it yourself, you will know for future problems, instead of relying on someone else on the forums.
Reply
#7

Quote:
Originally Posted by ConnorHunter
Посмотреть сообщение

6) Don't try to start learning from other scripts
Everybody learns in a different way.
I, personally, disagree with this point. But that's just a personal opinion.
Reply
#8

Thanks for the help. It still seems like a lot but now I kind of know where to start. I really hope to be making a good roleplay script at some point...
Reply
#9

nice to hear. +rep for trying to learn.
btw, add me on skype naclchemistryk, I can help you.
Reply
#10

Quote:
Originally Posted by SupaFool
Посмотреть сообщение
You can read the sa-mp wiki by clicking on the following link: https://sampwiki.blast.hk/, everything you need to know about pawn is there.

Also keep in mind that creativity is all you need to be a great scripting.

I'll suggest you to use zcmd and sscanf to code commands as its really easy and kinda fun also:

Example:

pawn Код:
CMD:heal(playerid, params[])
{
    new string[128], lookupid, pname[25], name[25];
    if(sscanf(params, "ui", lookupid))
    {
        format(string, sizeof (string), "* Usage: /heal (id/name).");
        SendClientMessage(playerid, 0xFFFF00FF, string);
        return 1;
    }
    GetPlayerName(playerid, pname, sizeof(pname));
    GetPlayerName(lookupid, name, sizeof(name));
    SetPlayerHealth(lookupid, 100);
    format(string, sizeof (string), "* You've healed %s (%d)!", name, lookupid);
    SendClientMessage(playerid, 0xFFFF00FF, string);
    format(string, sizeof (string), "* %s (%d) has healed you!", pname, playerid);
    SendClientMessage(lookupid, 0xFFFF00FF, string);
    return 1;
}
SSCANF: https://sampforum.blast.hk/showthread.php?tid=120356.
ZCMD: https://sampforum.blast.hk/showthread.php?tid=91354.

Good luck!
Why did you format a text at the sscanf stuff
You aren't using a variable or w.e, mlol.

OT: Use the wiki, or get some friends.
I learned scripting from the samp wiki and from some friends
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)