{
Change's the Weapon.dat value of Weapon ID to your custom one.
0AB1: @WEAPON_DAT 4 | -> Change Weapon 24 DAT 0x20 VALUE_TO 45 SIZE_OF_DAT 4 // MaxAmmo in Clip
Get DAT'S from http://hotmist.ddo.jp/struct.html
}
:WEAPON_DAT
0@ += 0x24 //+0x0 - no skill +0x19 - 50% skill +0x24 - 100% skill...
you need to allocate memory if you want to format strings. example:
alloc 16@ 64
format 16@ "enough memory here for 64 characters"
//do things with the string
free 16@
I'm trying to get the name of a CLEO script to a string to be used with 0A92: create_custom_thread "name.cs" to restart the script elsewhere. I did this so far, but it doesn't work properly if the name is more than 3 chars (xxx.cs) even with allocating memory to the string. Is there a memory...
for example:
alloc 0@ 64
format 0@ "UGBASE" //this could be any unknown string
//need to get only the first three characters of the string to end up with UGB
free 0@
I know you can do 0@ += 3 to get "ASE"
but is there a similar way of getting the first 3 characters of any string?
how do I properly use "alloc" and "free" inside a function? I am trying to return a string using the function, but when I free the allocated memory inside the function it returns random letters and symbols. It works if I don't free the memory in the function, but is this is a bad way?
So for...
Most snippets are functions so reading this tutorial will help you understand how to use them: http://ugbase.eu/Thread-0AB1-call-scm-function
For information on opcodes such as 0AD4: http://blast.hk/wiki/opcodes:sampfuncs:list (Google Translate if you don't speak Russian)
if not 31@ = samp.Base()
then
end_thread
else
while not samp.Available()
wait 100
end
end
It just a piece of code run once at the start of the script to check whether or not SAMP is installed (so you won't crash if you want to play singleplayer or...
0B3B: samp show_dialog id 0 caption "Dialog" text "First line" button_1 "Select" button_2 "Done" style DIALOG_STYLE_LIST
What is the correct way to add more lines to choose from in the listbox? This is for the basic SAMP dialog and not the SAMPFUNC one thank you. Also will the ID conflict with...
What is the simplest way to delete the first two characters from a string? I have both newOpcodes and SAMPFUNCS
format 0@ "xxstring"
//how to cut "xx"?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.