General Reference
#41

Quote:
Originally Posted by Alex
TBH the callback is called OnPlayerEnterVehicle, there's no reason it should be called if you're not going to enter it as it would be about as accurate as calling OnPlayerSpawn when someone gets in the water.
I guess the problem is that its currently unconsistent, if you are trying to enter a locked vehicle from a passengerdoor, OnPlayerEnterVehicle() is called and you see player animation of pulling a locked door. If you try to enter from driver door then OnPlayerEnterVehicle is not called and no animation.

Anyway the best solution would be that is was possible to lock vehicles from OnPlayerEnterVehicle without the carjack bug, this would avoid long loops through players everytime a car is locked/unlocked.
Reply
#42

Nice to know:

When using the built in SQLite library to connect to a database, then remember that the database needs to be SQLite3. Otherwize you won't be able to read data from it.

Connecting to a SQLite2 DB will not give any errors, but it won't return any records.
Reply
#43

Hello. Could somebody please tell me where and how I would get the exact coordinates of which the checkpoints in each of the 5 ammu-nation interiors are set. Somewhere they must be stored so that they can be used to set the coordinates ingame. Many thanks,

// Alistair .

Edit: No longer matters thanks, I found them in main.SCM after a headaching look.
Reply
#44

Look in the .ipl files located in \data\maps

In these .ipl are different sections, inst, cull, path, enex. What you need is to look the enex (= enters-exits), and find out which ones are the ones in ammunations.

This link can help you to undestand the enex parameters: http://www.gtaforums.com/index.php?showtopic=202532
Reply
#45

lol, i don't know if it's useful to know as i can't think of any application of it.
pawn Код:
for (new i = 0; i < 100000; i++)
  if (IsPlayerConnected(i))
    printf("playerid %d is connected", i);
Alone in my server,
Код:
playerid 0 is connected
playerid 256 is connected
playerid 512 is connected
playerid 768 is connected
playerid 1024 is connected
playerid 1280 is connected
playerid 1536 is connected
playerid 1792 is connected
playerid 2048 is connected

etc etc ...
Reply
#46

I'd assume from those numbers that playerid's are a byte and are modulo'd. 0%256 = 0, 1%257 = 1 .. 256%256 = 0, 257%256 = 1, 258%256 = 2 .. 512%256 = 0.
Reply
#47

hey...
Can you tell me the Sound ID,that begins when player complete mission in single player?
Reply
#48

Heres some detailed info about Vehicle names, weathers and pedestrian ID's

Vehicles

400 Landstalker
401 Bravura
402 Buffalo
403 Linerunner
404 Perennial
405 Sentinel
406 Dumper
407 Fire Truck
408 Trashmaster
409 Stretch
410 Manana
411 Infernus
412 Voodoo
413 Pony
414 Mule
415 Cheetah
416 Ambulance
417 Leviathan
418 Moonbeam
419 Esperanto
420 Taxi
421 Washington
422 Bobcat
423 Mr. Whoopee
424 BF Injection
425 Hunter
426 Premier
427 Enforcer
428 Securicar
429 Banshee
430 Predator
431 Bus
432 Rhino
433 Barracks
434 Hotknife
435 Articulate Trailer 1
436 Previon
437 Coach
438 Cabbie
439 Stallion
440 Rumpo
441 RC Bandit
442 Romero
443 Packer
444 Monster
445 Admiral
446 Squalo
447 Sea Sparrow
448 Pizza Boy
449 Tram (not fully supported, you will need a filterscript or that)
450 Articulate Trailer 2
451 Turismo
452 Speeder
453 Reefer
454 Tropic
455 Flatbed
456 Yankee
457 Caddy
458 Solair
459 Berkley's RC Van
460 Skimmer
461 PCJ 600
462 Faggio
463 Freeway
464 RC Baron
465 RC Raider
466 Glendale
467 Oceanic
468 Sanchez
469 Sparrow
470 Patriot
471 Quadbike
472 Coast Guard
473 Dinghy
474 Hermes
475 Sabre
476 Rustler
477 ZR-350
478 Walton
479 Regina
480 Comet
481 BMX
482 Burrito
483 Camper
484 Marquis
485 Baggage
486 Dozer
487 Maverick
488 News Chopper
489 Rancher
490 FBI Rancher
491 Virgo
492 Greenwood
493 Jetmax
494 Hotring
495 Sandking
496 Blista Compact
497 Police Maverick
498 Boxville
499 Benson
500 Mesa
501 RC Goblin
502 Hotring A
503 Hotring B
504 Bloodring
505 Rancher X
506 Super GT
507 Elegant
508 Journey
509 Bike
510 Mountain Bike
511 Beagle
512 Cropduster
513 Stuntplane
514 Tanker
515 Roadtrain
516 Nebula
517 Majestic
518 Buccaneer
519 Shamal
520 Hydra
521 FCR-900
522 NRG-500
523 HPV1000
524 Cement Truck
525 Towtruck
526 Fortune
527 Cadrona
528 FBI Truck
529 Willard
530 Forklift
531 Tractor
532 Combine Harvester
533 Feltzer
534 Remington
535 Slamvan
536 Blade
537 Freight
538 Streak
539 Vortex
540 Vincent
541 Bullet
542 Clover
543 Sadler
544 Fire Truck Los Santos
545 Hustler
546 Intruder
547 Primo
548 Cargobob
549 Tampa
550 Sunrise
551 Merit
552 Utility Van
553 Nevada
554 Yosemite
555 Windsor
556 Monster A
557 Monster B
558 Uranus
559 Jester
560 Sultan
561 Stratum
562 Elegy
563 Raindance
564 RC Tiger
565 Flash
566 Tahoma
567 Savanna
568 Bandito
569 Freight Flat
570 Streak Carriage
571 Kart
572 Mower
573 Dune
574 Sweeper
575 Broadway
576 Tornado
577 AT-400
578 DFT-30
579 Huntley
580 Stafford
581 BF-400
582 Newsvan
583 Tug
584 Tanker Trailer
585 Emperor
586 Wayfarer
587 Euros
588 Hotdog
589 Club
590 Freight Box
591 Articulate Trailer 3
592 Andromada
593 Dodo
594 RC Cam
595 Launch
596 Police Los Santos
597 Police San Fierro
598 Police Las Venturas
599 Police Countryside
600 Picador
601 S.W.A.T.
602 Alpha
603 Phoenix
604 Glendale Shit
605 Sadler Shit
606 Baggage Box A
607 Baggage Box B
608 Tug Stair
609 Boxville Burglary
610 Farm Trailer
611 Utility Trailer

Weather

Weather ID
0 Extra Sunny Los Santos
1 Sunny Los Santos
2 Extra Sunny Smoggy Los Santos
3 Sunny Smoggy Los Santos
4 Cloudy Los Santos
5 Sunny San Fierro
6 Extra Sunny San Fierro
7 Cloudy San Fierro
8 Rainy San Fierro
9 Foggy San Fierro
10 Sunny Las Venturas
11 Extra Sunny Las Venturas
12 Cloudy Las Venturas
13 Extra Sunny Countryside
14 Sunny Countryside
15 Cloudy Countryside
16 Rainy Countryside
17 Extra Sunny Desert
18 Sunny Desert
19 Sanstorm Desert
20 Kind of like Underwater

Commonly Used Ped ID's

9 Black, female, old, rich
10 Black, female, old, street
11 Black, female, young, croupier
12 Black, female, young, rich
13 Black, female, young, street
14 Black, male, old, rich
15 Black, male, old, street
16 Black, male, young, airport worker
17 Black, male, young, business
18 Black, male, young, beach
19 Black, male, young
20 Black, male, young, rich
21 Black, male, young, criminal
22 Black, male, young, street
23 White, male, young, BMX rider
24 Black, young, guard
25 Black, young, guard
26 White, male, young, backpacker
27 White, male, young, construction
28 Black, male, young, drug dealer
29 White, male, young, drug dealer
30 Hispanic, male, young, drug dealer
31 Desert, white, female, old
32 Desert, white, male, old
33 Desert, white, male, old
34 Desert, white, male, young
35 Hispanic, male, old
36 White, male, young, golfer
37 White, male, young, golfer
38 Hispanic, female, old, rich
39 Hispanic, female, old, street
40 Hispanic, female, young, rich
41 Hispanic, female, young , street
43 Hispanic, male, old, rich
44 Hispanic, male, old, street
45 Hispanic, male, young, beach
46 Hispanic, male, young, rich
47 Hispanic, male, young, criminal
48 Hispanic, male, young, street
49 Japanese, male, old, Kung fu master
50 White, male, young, mechanic
51 Black, male, young, hiker
52 White, male, young, hiker
53 Japanese, female, old, rich
54 Japanese, female, old, street
55 Japanese, female, young, rich
56 Japanese, female, young, street
57 Japanese, male, old, rich
58 Japanese, male, old, street
59 Japanese, male, young, rich
60 Japanese, male, young, street
61 White, male, young, pilot
62 Colonel Fuhrberger
63 Black, female, young, prostitute
64 Hispanic, female, young, prostitute
66 Black, male, young, pool player
67 Black, male, young, pool player
68 White, male old, priest
69 Black, female, young, street
70 White, male, old, scientist
71 White, male, young, security guard
72 San Fierro, White, male, young, hippie
73 San Fierro, White, male, young, hippie
75 San Fierro, white, female, old, prositute
76 White, female, young, stewardess
77 Unavalible
78 Unavalible
79 Unavalible
80 Las Venturas, black, male, young, boxer
81 Las Venturas, white, male, young, boxer
82 Las Venturas, hispanic, male, young, Elvis impersonator
83 Las Venturas, black, male, young, Elvis impersonator
84 Las Venturas, male, young, Elvis impersonator
85 Las Venturas, white, female, young, prostitute
87 Las Venturas, white, female, young, street
88 White, female, old, rich
89 White, female, old, street
90 White, female, young, jogger
91 White, female, young, rich
92 White, female, young, roller blader
93 White, female, young, street
94 White, male, old, rich
95 White, male, old, street
96 White, male, young, jogger
97 White, male, young, jogger
98 White, male, young, rich
99 White, male, young, roller blader
100 White, male, young, criminal
101 White, male, young, street
102 Ballas
103 Ballas
104 Ballas
105 Grove Street
106 Grove Street
107 Grove Street
108 Vagos
109 Vagos
110 Vagos
111 Mafia
112 Mafia
113 Mafia Boss
114 Aztecas
115 Aztecas
116 Aztecas
117 Triads
118 Triads
119 Triads
120 Triad Boss
121 Da Nang Boys
122 Da Nang Boys
123 Da Nang Boys
124 Mafia
125 Mafia
126 Mafia
127 Mafia
128 Desert, Native American, male, young
129 Desert, Native American, female, old
130 Desert, Native American, female, old
131 Desert, Native American, female, young
132 Desert, Native American, male, old
133 Desert, Native American, male, old
134 San Fierro, black, male, old, tramp
135 San Fierro, white, male, old, tramp
136 San Fierro, black, male, young, tramp
137 San Fierro, white, male, old, tramp
138 White, female, young, beach
139 Black, female, young, beach
140 Hispanic, female, young, beach
141 San Fierro, Japanese, female, young, business
142 San Fierro, black, male, young, street
143 San Fierro, black, male, young, criminal
144 Black, male, young, crack factory worker
145 White, female, young, crack factory worker
146 Hispanic, male, young, crack factory worker

I might add more peds... When i get the time
Reply
#49

Ahh yes, Thanks for showing me what to do Larzi, it was 10 PM in the night when I did that though
Reply
#50

This is general reference. That is a Useful Snippet.
Reply
#51

1593 - tire spikes
Reply
#52

The pawn_lang.pdf link should be updated.
Reply
#53

I was unsure about posting this in code snippets or here, but I think General Reference is more appropiate.

There is no native way to know if a File: tagged variable does currently hold an opened file or not. Even although it initialized at false, once fclose is called, it will stay true. This can be "fixed" by adding this simple snippet at the top of your code (before using fclose):

pawn Код:
stock default_fclose(File:handler)  return fclose(handler);
#define fclose(%1)  default_fclose(%1); %1=File:false
This way, you can now do stuff like:
pawn Код:
new File:handler;
if(handler)
    print("File is opened!");
else
    print("File is not opened");
Reply
#54

General limits can use an update, just like the rest of the topic.
Reply
#55

reupload pawnlang.pdf
Reply
#56

Quote:
Originally Posted by yom
View Post
Renaming default rcon commands - allowing you to basically rewrite them with PAWN:

Recently I had a pm of someone who wanted to modify default rcon commands. I don't remember it was discussed before, at least on this forum, so i've decided to write a quick tutorial about how to do it, as many people probably ignore how to do.

This example is for Windows, and i have no idea if this is working for linux. All you need is an hexadecimal editor. I personally use Notepad++ and the Hex editor plugin.
  • Make a backup of samp-server.exe, just in case you do something wrong.
  • Open samp-server.exe with your hex editor, and search for the rcon command that you want to modify*. In this tutorial i will search for gmx:

  • Replace (manually, not with the Replace option) the name of the command with something else of your choice*. I've replaced gmx by _gmx.

  • Save, done.

And now you can do things like that:
pawn Code:
public OnRconCommand(cmd[])
{
  if (!strcmp(cmd, "gmx", true, 3))
  {
    print("Gamemode is restarting...");
    SendRconCommand("_gmx"); //call the default gmx command
    return true;
  }

  return false;
}
*With the 0.3a server, you will find only one result for each command, with the exception of login which can be found easily anyway if you are not a complete dumbass, and can be max 7 characters, and exec which need to be modified twice (because it is called internally to load server.cfg) and must be 4 characters (or less, if you know what you are doing).



There are other tweaks that you can do while you have your samp-server.exe open in your hex editor.

I will show you two simple tweaks that can be easily applied with the Search and Replace function (search for hexadecimal values, NOT strings). Note that it was tested on 0.3r4 server, but that work since 0.1b so... Follow the guide!



Disabling server_log.txt:

This can be useful if you have your own logging system, or if you just want to disable it so it doesn't grow and waste space. The way i will show you now is the only way i've found that is safe.. but still, it's hacky as it replace the name of the file by a forbidden file name (previous methods were not as hacky, but also blocked samp.ban and crashinfo.txt so that's why i said mine is safer..)

Search and Replace:
Code:
00 73 65 72 76 65 72 5f 6c 6f 67 2e 74 78 74 00
By:
Code:
00 6e 75 6c 2e 74 78 74 00 00 00 00 00 00 00 00
There you go, no more server_log.txt will be created. Note that the reloadlog command will still say Reloaded log file: "server_log.txt", but that's probably a bug and you can ignore it.



Disabling the scriptfiles restriction:

This will allow PAWN's file functions to access files from outside the scriptfiles folder, as it is now allowed apparently, so be sure to update your scripts if you want to keep your files in scriptfiles, by adding "scriptfiles\\" in front of files names in fopen etc. So..for example with this tweak you can fread server.cfg, as well as other useful things..

Search and Replace:
Code:
00 73 63 72 69 70 74 66 69 6c 65 73 5c 00
By:
Code:
00 00 00 00 00 00 00 00 00 00 00 00 00 00
That one was easy..
Wow cool!! You are genious, thank!!!! Some is what I need ))
Reply
#57

join date 1970 ? :O
Reply
#58



Paintjob ID: 0
Vehicle's ownership: Camper
Color: Default (without custom color)
Can add in Single Player: No



Paintjob ID: 0
Vehicle's ownership: Remington
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Remington
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Remington
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 0
Vehicle's ownership: Slamvan
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Slamvan
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Slamvan
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 0
Vehicle's ownership: Blade
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Blade
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Blade
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 0
Vehicle's ownership: Uranus
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Uranus
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Uranus
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 0
Vehicle's ownership: Jester
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Jester
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Jester
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 0
Vehicle's ownership: Sultan
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 1
Vehicle's ownership: Sultan
Color: Default (without custom color)
Can add in Single Player: Yes



Paintjob ID: 2
Vehicle's ownership: Sultan
Color: Default (without custom color)
Can add in Single Player: Yes

Other Paintjobs here:
https://sampwiki.blast.hk/wiki/Paintjob
https://sampwiki.blast.hk/wiki/Paintjob_RU
Reply
#59

A little not to the people who are scripting and get the warning :

warning: Lose Indention

Take time to remember this

pawn Код:
//From a_samp
#pragma tabsize 4
// Ignores warning 217 for properly indented PAWNO code
// It's tab size is 4 and often uses 4 spaces instead, PAWNCC's is 8
Indention warning are nothing to worry about.
Reply
#60

Quote:
Originally Posted by ******
Посмотреть сообщение
These are the hex colour codes for the different gametext colours. The definitions are based on the patterns, so "SAMP_GAME_TEXT_RHH" is the colour of "~r~~h~~h~":

pawn Код:
#define MK_RGB(%0,%1,%2)                ((%0) << 24 | (%1) << 16 | (%0) << 8)

#define SAMP_GAME_TEXT                  MK_RGB(144,  98,  16)
#define SAMP_GAME_TEXT_                 MK_RGB(144,  98,  16)
#define SAMP_GAME_TEXT_H                MK_RGB(216, 147,  24)
#define SAMP_GAME_TEXT_HH               MK_RGB(255, 255,  54)

#define SAMP_GAME_TEXT_R                MK_RGB(180,  25,  29)
#define SAMP_GAME_TEXT_RH               MK_RGB(255,  37,  43)
#define SAMP_GAME_TEXT_RHH              MK_RGB(255,  55,  64)
#define SAMP_GAME_TEXT_RHHH             MK_RGB(255,  82,  96)
#define SAMP_GAME_TEXT_RHHHH            MK_RGB(255, 123, 144)
#define SAMP_GAME_TEXT_RHHHHH           MK_RGB(255, 184, 216)

#define SAMP_GAME_TEXT_G                MK_RGB( 54, 104,  44)
#define SAMP_GAME_TEXT_GH               MK_RGB( 81, 156,  66)
#define SAMP_GAME_TEXT_GHH              MK_RGB(121, 234,  99)
#define SAMP_GAME_TEXT_GHHH             MK_RGB(181, 255, 148)
#define SAMP_GAME_TEXT_GHHHH            MK_RGB(255, 255, 222)

#define SAMP_GAME_TEXT_B                MK_RGB( 50,  60, 127)
#define SAMP_GAME_TEXT_BH               MK_RGB( 75,  90, 190)
#define SAMP_GAME_TEXT_BHH              MK_RGB(112, 135, 255)
#define SAMP_GAME_TEXT_BHHH             MK_RGB(168, 202, 255)

#define SAMP_GAME_TEXT_Y                MK_RGB(226, 192,  99)
#define SAMP_GAME_TEXT_YH               MK_RGB(255, 255, 148)
#define SAMP_GAME_TEXT_YHH              MK_RGB(255, 255, 222) // Also in green

#define SAMP_GAME_TEXT_P                MK_RGB(168, 110, 252)
#define SAMP_GAME_TEXT_PH               MK_RGB(252, 165, 255)
#define SAMP_GAME_TEXT_PHH              MK_RGB(255, 247, 255)

#define SAMP_GAME_TEXT_W                MK_RGB(255, 255, 255)

#define SAMP_GAME_TEXT_L                MK_RGB(  0,   0,   0)
Thanks you ^^
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)