18.12.2016, 19:31
Little coding questions - For general minor queries 5
18.12.2016, 19:34
18.12.2016, 19:46
18.12.2016, 20:06
Код:
#if defined _ALS_GivePlayerWeapon #undef GivePlayerWeapon #else #define _ALS_GivePlayerWeapon #endif #define GivePlayerWeapon GivePlayerWeaponEx
18.12.2016, 20:09
Tell me what you want to do first.
18.12.2016, 21:01
Functions don't get called by players/clients, thats what callbacks are for, functions are as the name stands, functions for the coder to use.
18.12.2016, 21:18
18.12.2016, 22:33
19.12.2016, 13:08
Anyone has a clue why my inputtext isn't working properly? It occassionally adds/switches random characters.
EDIT: I should note that I use y_inline for all of my dialogs and they all work properly, except for this one.
Debug output:
Robert_Sheldon:
Billy_Joe:
EDIT: I should note that I use y_inline for all of my dialogs and they all work properly, except for this one.
PHP код:
if ( playertextid == creation_nameSel [ playerid ] ) {
inline creation_NameSel(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused pid, dialogid, listitem
if ( ! response ) {
// No choice
}
if ( response ) {
if ( ! IsRPName ( inputtext )) {
return Dialog_ShowCallback ( playerid, using inline creation_NameSel, DIALOG_STYLE_INPUT, "Character: Name Selection", "Enter your character's name.\n\n\
Your name isn't a valid roleplaying name!\nIt has to be in a Firstname_Lastname format.\nIt can't be smaller than 5, or longer than 24 characters.", "Continue", "Cancel" );
}
new nameString [ 64 ] ;
player_nameSelect [ playerid ] [ 0 ] = EOS ;
strcat(nameString, inputtext, MAX_PLAYER_NAME ) ;
strcat ( player_nameSelect [ playerid ], inputtext, MAX_PLAYER_NAME ) ;
if ( strlen ( inputtext ) > 10 ) {
strdel(nameString, 10, sizeof ( nameString ) ) ;
strins(nameString, "...", 10, sizeof ( nameString ) ) ;
}
format ( nameString, sizeof ( nameString ), "Name~w~ %s", nameString ) ;
PlayerTextDrawSetString(playerid, creation_nameSel [ playerid ], nameString ) ;
}
}
return Dialog_ShowCallback ( playerid, using inline creation_NameSel, DIALOG_STYLE_INPUT, "Character: Name Selection", "Enter your character's name.", "Continue", "Cancel" );
}
Robert_Sheldon:
Код:
[14:56:17] [Inputtext]: Roaert_Sheldon | [NameStr]: Roaert_Sheldon | [NameSelect]: Roaert_Sheldon
Код:
[14:56:17] [Inputtext]: Bihly_Joe | [NameStr]: Bihly_Joe| [NameSelect]: Bihly_Joe
19.12.2016, 13:21
I already told you in a previous reply. The fact you don't want to tell me what you are trying to do is stupid, so that's the only answer I'm giving you.
Do more debugging (removing parts until it's normal then abnormal / printing after each instance).
Quote:
Anyone has a clue why my inputtext isn't working properly? It occassionally adds/switches random characters.
EDIT: I should note that I use y_inline for all of my dialogs and they all work properly, except for this one. PHP код:
Robert_Sheldon: Код:
[14:56:17] [Inputtext]: Roaert_Sheldon | [NameStr]: Roaert_Sheldon | [NameSelect]: Roaert_Sheldon Код:
[14:56:17] [Inputtext]: Bihly_Joe | [NameStr]: Bihly_Joe| [NameSelect]: Bihly_Joe |
19.12.2016, 13:36
Quote:
Do more debugging (removing parts until it's normal then abnormal / printing after each instance).
|
Either way, I suspect my hooks fucked it up or something because I put it in an individual function and it works perfectly now.
19.12.2016, 14:24
Quote:
Anyone has a clue why my inputtext isn't working properly? It occassionally adds/switches random characters.
EDIT: I should note that I use y_inline for all of my dialogs and they all work properly, except for this one. PHP код:
Robert_Sheldon: Код:
[14:56:17] [Inputtext]: Roaert_Sheldon | [NameStr]: Roaert_Sheldon | [NameSelect]: Roaert_Sheldon Код:
[14:56:17] [Inputtext]: Bihly_Joe | [NameStr]: Bihly_Joe| [NameSelect]: Bihly_Joe |
This can be because of IsRPName function, or any other function used thru OnDialogResponse hooks.
19.12.2016, 14:27
20.12.2016, 02:57
Hey does it matter if you use a strong tag or a weak tag with enums?
Then again why do people use _: with enums?
Код:
enum E_Test//Strong tag { E_Sum = 5 }; enum e_test//Weak tag { e_sum = 1 };
20.12.2016, 02:59
Quote:
Hey does it matter if you use a strong tag or a weak tag with enums?
Код:
enum E_Test//Strong tag { E_Sum = 5 }; enum e_test//Weak tag { e_sum = 1 }; |
_: is to detag something (remove tag)
20.12.2016, 03:06
20.12.2016, 10:42
(
Последний раз редактировалось Logic_; 20.12.2016 в 11:22.
)
Can somebody explain me...
KickTimer function
Quote:
[16:28:06] [debug] Run time error 6: "Invalid instruction" [16:28:06] [debug] Unknown opcode 0x2c at address 0x000E11F0 [16:28:06] [debug] AMX backtrace: [16:28:06] [debug] #0 native Kick () from samp-server.exe [16:28:06] [debug] #1 00000004 in ?? (0) from CLASSIFIED.amx [16:28:06] [debug] #2 0005c194 in public SSCANF_OnPlayerDisconnect (0, 2) from CLASSIFIED.amx [16:28:06] [debug] #3 00003b24 in public KickTimer (0, 2) from CLASSIFIED.amx |
Код:
forward KickTimer(playerid); public KickTimer(playerid) { if(playerid != INVALID_PLAYER_ID) Kick(playerid); return 1; }
20.12.2016, 10:50
Quote:
That means nothing, you could go all capslock too. It's just the name.
_: is to detag something (remove tag) |
https://sampforum.blast.hk/showthread.php?tid=318307
Yes, they do have a difference:
Quote:
Strong & Weak tags: pawn Код:
pawn Код:
|
Quote:
Can somebody explain me...
KickTimer function Код:
forward KickTimer(playerid); public KickTimer(playerid) { if(playerid != INVALID_PLAYER_ID) Kick(playerid); return 1; } |
Quote:
public KickTimer (0, 2) |
Also I assume this is a linux server? if yes there's a tutorial on how to get more meaningful crash reports.
20.12.2016, 10:54
Woops, double post -_-
20.12.2016, 11:04
Quote:
Idk if that seems to be the origin but by the looks of it you are passing yet another parameter to KickTimer, you should fix that.
You should consider re-compiling your code with debug lvl 3 (-d3) when testing your code. Also I assume this is a linux server? if yes there's a tutorial on how to get more meaningful crash reports. |
-d3 doesn't works, it doesn't show shit on my compiler output except for some warnings. I replaced my compiler and everything when 0.3.7 got released and downloaded all the new includes and stuff. Linux and Windows server output the exact same errors.
« Next Oldest | Next Newest »
Users browsing this thread: 7 Guest(s)