Learning Pawn.
#1

I know about the guides what have been stickied and all, but I was wondering if there is anything better to learn from, how did you guys learn, in what way, from what site, how long did it take, what kept you motivated and how did you improve,
  • Did you start by editing a roleplay server?
  • Did you start by creating a deathmatch server?
So basically how can I learn to script, I tend to enjoy it more if I feel I'm getting somewhere, but I just can't seem to get my head around it. Please, I want to make my own script, eventually creating my own roleplaying community, I'm not inpatient, I can take my time around getting known to the language, but I need to see an improvement or I just quit because I think I'm not achieving anything, please guys, tell me how you got going!

Please guys, I don't want to make one of them edits, I want to make my own legit script, something to be proud of!
Reply
#2

I started by making small FS-es and maps... you should do that. My first gamemode was stunt, its probably one of the easyest of all. You should start by making small FS-es (Please, no AFK system)

ALso be sure to read wiki.sa-mp.com
Reply
#3

I am still in learning point, but the easiest way of learning, is to ask friend to show you how something is done, take a look at other scripts, and learn by that.

Personally I dont use tutorials, at all.
Reply
#4

Hmm, well I don't have anyone to teach me, well atleast no one cares, but I sort of understand if they've better stuff to do, I've been looking at a script and been freaked out by this, it makes me think it's going to be impossible:

new stat[32];
strmid(stat, tmp, 0, sizeof(stat), sizeof(stat));
if (strcmp(stat, "Cash", true) == 0)
{
if(GetPlayerCash(playerid) >= 200)
{
if(GasTanks[playerid] == 3)
{
Reply
#5

I'm guessing them two lines are getting information from .ini files, I'm correct?
Reply
#6

pawn Code:
if(GetPlayerCash(playerid) >= 200)
Checks if player has less or equal to 200 money
pawn Code:
if (strcmp(stat, "Cash", true) == 0)
Normal Format of strcmp
pawn Code:
new stat[32];
Making New Functon Called 'stat' that is 32 cells big array.

Personally, I say, use zcmd, that is the most easiest command system. Its faster and a lot easier to learn than the strcmp.
Reply
#7

strcmp, why's it so popular then,


What's cells and arrays?


Also, what pawn editor do you use? Like PawnoX or something?
Reply
#8

I personally learned by editing lvdm and a51 that were included in the SA:MP Download package (a51 no longer included). And there is no set time to how long it takes to learn, since you learn something new everyday! Also, just search the forums for the thousands of threads like yours. There have been multiple listed ways of learning.

pawn Code:
new stat[32];
Creates a new 32-cell array.
pawn Code:
strmid(stat, tmp, 0, sizeof(stat), sizeof(stat));
Extracts the data inside "tmp" array into the "stat" array, starting at position 0. - https://sampwiki.blast.hk/wiki/Strmid
pawn Code:
if(strcmp(stat, "Cash", true) == 0)
Compares the contents of "stat" to the word "Cash", while ignoring case. - https://sampwiki.blast.hk/wiki/strcmp
pawn Code:
if(GetPlayerCash(playerid) >= 200)
Checks if the player's money is greater than or equal to 200.
pawn Code:
if(GasTanks[playerid] == 3)
Checks if the 'GasTanks' variable for 'playerid' is equal to 3.
Reply
#9

Use the original editor, PAWNO as it comes.

Strcmp for commands is popular due the old (ex: GF) using that anticuated and un - efficent system.

I believe you should use zcmd along with sscanf 2.0. It's a misbelief using strcmp as commands, as it should be used only to compare two strings ..

Arrays is a value used to store information in it, cells is the size of the array. I think you should read the PAWN beginner guide.
Reply
#10

Using DCMD is just as bad as using strcmp. And you ARE comparing two strings when checking commands via that method.

But I know what you're getting at.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)