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
0
votes
1 answer

invalid expression, assumed zero must be a constant expression

(1204) : error 029: invalid expression, assumed zero (1204 -- 1205) : error 008: must be a constant expression; assumed zero (1203) "{CCFF99}[INFO]:{FFFFFF} Nu uita sa faci poza la {CCFF99}/stats{FFFFFF} periodic.", (1204) } …
0
votes
1 answer

Pawn Language : Parameters in the enum function

I'm learning about Pawn language . I'm having trouble with parameters in the enum function enum E_MY_TAG (<<= 1) { E_MY_TAG_NONE, E_MY_TAG_VAL_1 = 1, E_MY_TAG_VAL_2, E_MY_TAG_VAL_3, E_MY_TAG_VAL_4 } new E_MY_TAG:gMyTagVar =…
Neko
  • 9
  • 6
0
votes
1 answer

Pawn, PHP and MySQL

I am trying to connect to my MySQL host in Hostinger from Pawn language ... I do not know why I am getting these errors: [17:25:26] [ERROR] CMySQLConnection::Connect - (error #2005) Unknown MySQL server host 'mysql.hostinger.co.il' (0) [17:25:26]…
Ben
  • 13
  • 4
0
votes
1 answer

Interpolating a color, in a simple function

With the following code, I'm supposed to be able to do WC_InterpolateColor(0xFF0000, 0xFFFF00, 0.5) and get the color that is halfway in between the two colors specified (red and yellow in this case). The pos value should be between 1.0 and 0.0. The…
Corey Iles
  • 155
  • 1
  • 17
0
votes
1 answer

Generate user_password phpBB

I have a gameserver running on the same server as a phpBB forum. I want to make users verify their identity to the gameserver by entering their phpBB username and password. I know how to do this with their username (simply get their username and…
James Monger
  • 10,181
  • 7
  • 62
  • 98
0
votes
1 answer

X,Y axis skew line how go up/down/sides

I have two points, one start position and a goal position(dynamic). I want to spawn players as they would in a formula 1 race. i.e the second a little to the right and back of the first, third left and back of the second and so on. I have already…
ikdekker
  • 3
  • 3
0
votes
1 answer

How to use Pawn in C#

Is it possible, to use Pawn (language) in C#? I have an application and I would like to offer others to write modifications/plugins with Pawn. I found JavaScript interpreter, Jint, but I can't find any similar library for Pawn.
tebeix
  • 13
  • 4
0
votes
4 answers

Array index out of bounds error Pawn

I am using spawn points but when it compiles I'm getting this error: Array index out of bounds On this line is the error for(new i =0 ; i < 5 ;i++) { SetPlayerPos(playerid, spawnpoints[i][0], spawnpoints[i][1], spawnpoints[i][2]); } Hoping…
Clove
  • 29
  • 2
  • 6
0
votes
2 answers

"Invalid expression, assumed zero" error on if-statement

I'm getting the following error whenever I compile my code: "Error 029: Invalid expression, assumed zero" The error is thrown on the following line: if ((PlayerInfo[playerid][ADMINLevel])) || (IsPlayerAdmin(playerid)) I want the if-statement to…
Clove
  • 29
  • 2
  • 6
0
votes
2 answers

Decrypting Unknown Hash Encryption

I'm moving to MYSQL from files and I want to use md5 instead of Encryption public Encrypt(string[]) { for(new x=0; x < strlen(string); x++) { string[x] += (3^x) * (x % 15); if(string[x] > (0xff)) { string[x] -= 256; } } …
user1546616
  • 43
  • 1
  • 5
0
votes
1 answer

Passing an array variable through an associated array in PAWN (.p files)

I am new to the programming world (and very excited to be a part of it). I believe What I am trying to do is very simple, however I can't find a whole lot on PAWN file programming that isn't for SA-MP. I have a '.p' file that is supposed to check an…
brandoncluff
  • 303
  • 1
  • 5
  • 19
0
votes
2 answers

What are possible ways of converting these bitmask definitions from pawn language to PHP?

Well, to clarify, pawn is a language that is pretty similar to C++. I'm programming an Admin Control Panel that requires bit mask permissions (in php) and I actually don't know if I converted the permissions properly (since it's something I have…
0
votes
1 answer

String contains or regex in pawn scripting language

or example if(playerName.Contains("<") || playerName.Contains("-")){ } or how i can check string with regex pattern(^[-0-9A-Za-z_]{5,15}$) Thanks
Irakli Lekishvili
  • 33,492
  • 33
  • 111
  • 169
-1
votes
1 answer

Working with pwn for a server and getting thesse errors

so I'm working on a server base for sa-mp using pwn and have finished the script guide I followed they are all really old so they come with issues, I tried to fix them but have no clue what I'm doing lol.these are the errors I am getting This is the…
Creepz
  • 1
-1
votes
1 answer

SAMP Pawno mysql r41-4 invalid connection handle '1'

I've encountered a problem with latest MySQL r41-4 release. I'm getting invalid connection handle '1' error. code : https://pastebin.com/wTc7BbtD For example, if the non registered player enters server for the first time: public …
DeeKeiD
  • 1
  • 1