[FilterScript] [MySQL][RP] Simple Phone System
#18

Quote:
Originally Posted by GhostHacker9
View Post
The pawn language supports tags both from natively as well as from SA-MP. use bool tag to increase the readability

PHP Code:
enum PlayerSIM
{
    
Activated//talking about this 
doesn't matter
https://sampforum.blast.hk/showthread.php?tid=105318

Quote:
Originally Posted by GhostHacker9
View Post
PHP Code:
CallStarted[MAX_PLAYERS],
    
TimerPhone[MAX_PLAYERS],
    
IsCalled[MAX_PLAYERS], 
https://sampwiki.blast.hk/wiki/MAX_PLAYERS


Quote:
Originally Posted by GhostHacker9
View Post
PHP Code:
#define G   "{6EF83C}"
#define R   "{F81414}"
#define W   "{FFFFFF}"
#define O   "{FFAF00}"
#define YE  "{FFFF00}"
#define GRI "{C0C0C0}" 
it's complety fine. i perfer this names

Quote:
Originally Posted by GhostHacker9
View Post
Code:
 new queryS[128];
    mysql_format(register, queryS, sizeof(queryS), "SELECT * FROM `phone` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
Code:
new str[200];
you right in this one

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";
^^who taught you maths?i just want to see that person.

PHP Code:
 
PHP Code:

[QUOTE=GhostHacker9;3831654]
and 
this
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_PHONE)
    {
[/
QUOTE
Quote:
Originally Posted by GhostHacker9
View Post

^^use switches instead of ifs as it is better for both readability as wells as faster execution.
Doesn't matter.

Quote:
Originally Posted by GhostHacker9
View Post
PHP Code:
DIALOG_PHONE+1
DIALOG_PHONE
+2
DIALOG_PHONE
+3
//****** 
^^again bad naming concepts you have
what wrrong in this again ? it's the most naming used DIALOG_* try to search in scripts please.

Quote:
Originally Posted by GhostHacker9
View Post
PHP Code:

stock GetName
(playerid)
{
    new 
szName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridszNamesizeof(szName));
    return 
szName;

^^ another bad habit a good programmer cares about data structure rather than code. Instead creating an overhead to this function every time its better to have per player array to hold name on connection and not to mention your database arrangement too it is also needed to normalized.
well. let's go logic

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
also the most bigs servers uses this functions (xSF, LVP, ...)

etc
Reply


Messages In This Thread
[MySQL][RP] Simple Phone System - by Yaa - 20.01.2017, 21:57
Respuesta: [MySQL][RP] Simple Phone System - by Eloy - 20.01.2017, 22:16
Re: [MySQL][RP] Simple Phone System - by iLearner - 20.01.2017, 22:19
Re: [MySQL][RP] Simple Phone System - by Yaa - 20.01.2017, 22:23
Re: [MySQL][RP] Simple Phone System - by iLearner - 20.01.2017, 22:27
Re: [MySQL][RP] Simple Phone System - by Yaa - 20.01.2017, 22:32
Re: [MySQL][RP] Simple Phone System - by iLearner - 20.01.2017, 22:40
Re: [MySQL][RP] Simple Phone System - by oMa37 - 20.01.2017, 22:48
Re: [MySQL][RP] Simple Phone System - by Quinncell - 20.01.2017, 22:50
Re: [MySQL][RP] Simple Phone System - by iLearner - 20.01.2017, 22:53
Re: [MySQL][RP] Simple Phone System - by RyderX - 21.01.2017, 04:13
Re: [MySQL][RP] Simple Phone System - by Bolex_ - 21.01.2017, 08:27
Re: [MySQL][RP] Simple Phone System - by Quinncell - 21.01.2017, 10:19
Re: [MySQL][RP] Simple Phone System - by Yaa - 21.01.2017, 10:25
Re: [MySQL][RP] Simple Phone System - by oMa37 - 21.01.2017, 10:29
Re: [MySQL][RP] Simple Phone System - by Quinncell - 21.01.2017, 10:30
Re: [MySQL][RP] Simple Phone System - by GhostHacker9 - 21.01.2017, 10:50
Re: [MySQL][RP] Simple Phone System - by Yaa - 21.01.2017, 11:06
Re: [MySQL][RP] Simple Phone System - by GhostHacker9 - 21.01.2017, 11:14
Re: [MySQL][RP] Simple Phone System - by oMa37 - 21.01.2017, 11:16

Forum Jump:


Users browsing this thread: 4 Guest(s)