Questions tagged [pawn]

Pawn, formerly known as Small, is an open source scripting language primarily intended as an embeddable scripting language

Pawn is a typeless language influenced by Small-C. and has C-like syntax.

Pawn is used in the San Andreas Multiplayer mod, Half-Life mod, AMX Mod X and Source Engine based SourceMod as well as various other projects.

Features

  • Pawn is a C-like Scripting Language
  • You can include files in Pawn; so you can arrange a neat structure of Pawn code
  • Pawn is a scripting language with a compiler that performs static checks, and an abstract machine with (static) P-code verification and dynamic checks.
  • For porting purposes, Pawn is written in ANSI C as much as possible; Endian issues are handled.
  • Pawn supports Unicode/UCS-4 and UTF-8, as well as codepages. The compiler can convert source code entered in a particular codepage to Unicode; it also supports source code files in UTF-8 format.
  • It has been fitted on an Atmel ATmega128 microcontroller, Philips LPC2138 and LPC2106 microcontrollers (ARM7TDMI core with 32 kiB RAM), as well as on a Texas Instrument's MSP430F1611 (MSP430 core with 10 kiB RAM and 48 kiB Flash ROM). Using code overlays that are loaded on demand, pawn is able to run large scripts in little memory.
  • Documenting the source code can be done with "documentation comments;" the pawn compiler extracts those comments, combines them with information it deduces from the source code and writes an XML file that is immediately viewable (and printable) with a web browser.
  • Pawn supports states and automatons in the language, including state-local variables.

Resources

49 questions
4
votes
1 answer

convert unix time to date

i'm doing a function, to convert unix time to date (dd-mm-yyyy) stock UnixToTime(x) { new year = 1970; new dia = 1; new mes = 1; while(x > 86400) { x -= 86400; dia ++; if(dia == getTotalDaysInMonth(mes,…
iZume
  • 119
  • 1
  • 11
3
votes
1 answer

How to fix dark skin issue on SAMP class selection in pawn?

I'm working on a SAMP server using pawn language, but I've started facing an issue since I started work on SAMP player skin selection class. The issue is when a player request's a class all skins becomes darker. My Code: public…
Jazz
  • 214
  • 2
  • 10
2
votes
1 answer

Make function to format date with days adding

okay, example. I have: 18-03-2016 And i have a function and in the function is possible add days, month and years (with params) if i add 14 days and 4 months, the days following that format will be: 32-07-2016 i need make function to add…
iZume
  • 119
  • 1
  • 11
2
votes
1 answer

Sublime Text no build output

Using build option does not give any output except of [Finished in 0.4s] I didn't configure any c++.sublime-build file, I just installed C++ compiler and added it to the system path. It should work out of the box, but it is not. I also use Pawn…
mikesrike
  • 21
  • 1
  • 3
2
votes
1 answer

Player Spawning Bug

When I run my game mode the player is supposed to spawn at the coordinates given in OnPlayerSpawn. Its works perfectly but after I press the "Spawn" button the screen flashes showing my player at the default samp coordinates(the little place with…
user3059477
  • 21
  • 1
  • 5
1
vote
1 answer

Format specifiers in mysql plugin for pawn language

Following is a function to commit suicide in game forward killPlayer(playerid); public killPlayer(playerid) { new query[128]; if(GetPVarInt(playerid, "commitSuicide") == 1) { mysql_format(MainPipeline, query, sizeof(query),…
1
vote
2 answers

Is there a similar approach to the following code from Pawn in Java?

I used to code in Pawn years ago but now I am working with other languages. This is a piece of code that allowed me to create 3d arrays with enum. enum healthHack { Float:acHealth, bool:hImmune, bool:aImmune, Float:acArmour, …
1
vote
1 answer

GTA SA-MP Scripting: Dynamic objects did not render after 20,000 x coordinates

I've created a map that exceeded 20,000 in x coordinates (east of los santos) and i've set my SetPlayerWorldBounds(playerid, 500000.00, -2000.00, 2000.00, -500000.00) and used the latest version of incognito plugin but when I reached more than…
user9315910
1
vote
1 answer

Reverse string in PAWN language

I try to reverse word but stack in some problem which I can’t explain and don’t know what to do. new word{8}; GetWord(coords, word); printf ("%s\n", word); new doubleWord {16}; new reversedWord {16}; strcat (doubleWord, word, 16); printf…
Raccoon
  • 67
  • 6
1
vote
1 answer

How to integrate PAWN compiler into Eclipse?

I want integrate PAWN compiler and its syntax highlighting into Eclipse... What's the recommended way to do that? Is it possible? Thanks. https://compuphase.com/pawn/pawn.htm
Yousha Aleayoub
  • 4,532
  • 4
  • 53
  • 64
1
vote
2 answers

SA-MP servers crashes at start

I have a server for almost 4 years and I didn't have any problems (host side) until now. I changed hostings all the time because ddos stuff trying to find best for me. Now I buyed one VPS (its not my first) and tried to run my server and i have…
Fifa Anes
  • 11
  • 4
1
vote
2 answers

A simple command in PAWN

San Andreas Multiplayer (GTA) uses PAWN as its programming language. I'm an owner of a server on SA-MP and I'm not that pro so I'd like to get some help if possible. Basically, I have a command that checks player's statistics when he/she is online,…
KevinBurke
  • 11
  • 3
1
vote
1 answer

What is meaning of underscore in front of function in PAWN?

In php underscore ("_") it's declaration of private/protected function but i didn't found anything about it in PAWN. Does it have any meaning in PAWN?
Paradiso
  • 39
  • 4
  • 8
1
vote
1 answer

Maze Generation - Converting From C++

Ok, many of you may not know what Pawn is. I'm converting the source from here http://en.wikipedia.org/wiki/User:Dllu/Maze to work in my SA:MP server. Pawn is a very easy code to understand so don't run because you don't know the language. For some…
Corey Iles
  • 155
  • 1
  • 17
1
vote
1 answer

How to make a command require RCON login

How can I make a command require the player to be logged in via RCON in order to execute it? I wish to do this for security reasons.
Clove
  • 29
  • 2
  • 6
1
2 3 4