21.01.2017, 11:06
Quote:
The pawn language supports tags both from natively as well as from SA-MP. use bool tag to increase the readability
PHP Code:
|
https://sampforum.blast.hk/showthread.php?tid=105318
Quote:
PHP Code:
|
Quote:
PHP Code:
|
Quote:
Code:
new queryS[128]; mysql_format(register, queryS, sizeof(queryS), "SELECT * FROM `phone` WHERE `Name` = '%s' LIMIT 1", GetName(playerid)); Code:
new str[200]; Code:
new isp[20]; if(PhoneInfo[playerid][ISP] == 1) isp = "SAT"; if(PhoneInfo[playerid][ISP] == 2) isp = "LVT"; if(PhoneInfo[playerid][ISP] == 3) isp = "SFT"; PHP Code:
|
PHP Code:
[QUOTE=GhostHacker9;3831654]
and this
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_PHONE)
{
[/QUOTE]
Quote:
^^use switches instead of ifs as it is better for both readability as wells as faster execution. |
Quote:
PHP Code:
|
Quote:
PHP Code:
|
Quote:
every time you call for GetPlayerName the server search for definition of it so he will search on samp-server.exe for native and will amx_function things better make one stock than use this native every time also there just one string better than a string with 24 cells for every uses exemple normal : in script with 1k line: GetPlayerName used 15 times so 15 x 24 = 360 cells added (average of 360 kb) optimized : in script with 1k line: GetPlayerName used 15 times with using stock so 1 x 24 = 24 cells (average of 24 kb) results: 224 cells/kb optimized |
etc