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

Simple Phone System


Introduction:

this is a simple filterscript for a samp server ! this system uses MySQL Saving engine !
there ISP System ! and also phone money (not main monry) !!
and there 2 phone dealers one in LV and second at SF
also there 3 ISP's (San Andreas Telecom, San Fierro Telecom, Las Venturas Telecom)

the feature of every one are different

SAT = 10 $ / sec taking in phone
SFT = 70 $ / sec taking in phone
LVT = 50 $ / sec taking in phone

also prices are different for more informations use it !

Commands:

PHP код:

/call Call someone by entring his id finish call
/phone See your stats (ISPMoney)
/
decline Deny a call coming to you
/answer accept a call coming to you 
Callbacks:

PHP код:
public onCallStarted(playeridtargetid)
public 
onCallCostTake(playerid)
public 
onCallFinished(playeridreason
Screenshots:

http://imgur.com/a/pRdh0

How to install ?:

1- Download Phone.pwn from gihub or copy it from pastebin
*Pastebin: past it and save it on Phone.pwn

2- Change
PHP код:
#define MySQL_Host ""
#define MySQL_User ""
#define MySQL_DB   ""
#define MySQL_Pass ""
#define MySQL_Port 3306 
to your mysql informations

3- Press F5

4- copy *.amx file to your fiterscripts folder

5- add it in server.cfg (filterscripts phone)

6- Restart/Start server

7- Have fun !

Download Link:

Pastebin: http://pastebin.com/nYcRvrF2

Github: https://github.com/LVPYassine/Simple...eases/tag/v1.0

Bugs:

if you find a bug feel free to post a reply/pm me or just open issue at github

Credits:

*SA-MP Team
*BlueG & maddinat0r for MySQL Plugin
*Zeex for zcmd
******* for sscanf
*Incognito for streamer plugin

Have fun !!

Yaa
Reply
#2

Good Work! I like your system, i needed to complete my script RP Mysql

Thanks...
Reply
#3

Though i wouldnt permit to do so, to the lead scripter! but...

Just a tip, use string[128] (you're using [200], even tho you do know, or should know max length is 128 ).

None of your messages actually (or i'd say hardly) are long even 100 chars.
Reply
#4

Enjoy !

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Though i wouldnt permit to do so, to the lead scripter! but...

Just a tip, use string[128] (you're using [200], even tho you do know, or should know max length is 128 ).

None of your messages actually (or i'd say hardly) are long even 100 chars.
wat if some newbie edit messages

1- complie it
2- got error (array too small)
3- delete fs and come here reply negative replies :O

#true_story
Reply
#5

I now, feel ashamed even while using the picard for your reactions...

That's not the right way to think sir! comments! they are a important part of a script, very important!

And can you show me a example for where it would say array size ... ?
Reply
#6

Quote:
Originally Posted by Eloy
Посмотреть сообщение
Good Work! I like your system, i needed to complete my script RP Mysql

Thanks...
Quote:
Originally Posted by iLearner
Посмотреть сообщение
I now, feel ashamed even while using the picard for your reactions...

That's not the right way to think sir! comments! they are a important part of a script, very important!

And can you show me a example for where it would say array size ... ?
PHP код:
2got error (array too small
i mean with it text not completed when scm (also colors are counted if he add some onces )

Quote:
Originally Posted by iLearner
Посмотреть сообщение
I now, feel ashamed even while using the picard for your reactions...
Reply
#7

1 Star sorry, you're simply here to argue without even trying to understand what other party is trying to say.

You're fee to say shit down here, and I couldn't care less about your shit location.

night.
Reply
#8

As iLearner said, You need to decrease the size of strings, You're using a 200 length string for a 70 text length.
Reply
#9

How would you '/hangup' during a call?

Since you call yourself 'lead samp scripter' I'd expect so much more.
Reply
#10

Quote:

*Emmet for sscanf

Just a friendly reminder, the actual credits goto ******, emmet somehow maintained it.
Reply
#11

Nice work Yaa, but try to be positive with people's feedback..
Reply
#12

Quote:
Originally Posted by KeithCooper
Посмотреть сообщение
How would you '/hangup' during a call?

Since you call yourself 'lead samp scripter' I'd expect so much more.
Reply
#13

Quote:
Originally Posted by Scripter18
View Post
Is this becoming a thing? All of the retarded people quote others and just add 'facepalm?

If you misunderstood me, I meant was; where is the '/hangup' command, since you can obviously hangup during calls..
Reply
#14

Quote:
Originally Posted by KeithCooper
View Post
Is this becoming a thing? All of the retarded people quote others and just add 'facepalm?

If you misunderstood me, I meant was; where is the '/hangup' command, since you can obviously hangup during calls..
"/call - Call someone by entring his id / finish call"

Reply
#15

Quote:
Originally Posted by Yaa
View Post
"/call - Call someone by entring his id / finish call"

Stop using this shitty meme on every single post for fuck sake!
Reply
#16

Quote:
Originally Posted by Yaa
View Post
"/call - Call someone by entring his id / finish call"

Didn't even see that, using my phone..

Stop with the "picard"! Do you remember the questions you asked me in PMs?? Stop acting like a smart ass and remember the stupidity you really have.
Reply
#17

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 
PHP Code:
CallStarted[MAX_PLAYERS],
    
TimerPhone[MAX_PLAYERS],
    
IsCalled[MAX_PLAYERS], 
^^ wastage of memory use char arrays instead.

PHP Code:
#define G   "{6EF83C}"
#define R   "{F81414}"
#define W   "{FFFFFF}"
#define O   "{FFAF00}"
#define YE  "{FFFF00}"
#define GRI "{C0C0C0}" 
^^ never use such names on constants or identifiers. Its just bad programming or scripting method.(its enough to understand your lack of experience)
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";
^^who taught you maths?i just want to see that person.

PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOG_PHONE)
    { 
^^use switches instead of ifs as it is better for both readability as wells as faster execution.

PHP Code:
DIALOG_PHONE+1
DIALOG_PHONE
+2
DIALOG_PHONE
+3
//****** 
^^again bad naming concepts you have


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 it also need to normalized.

I can tell even more and you send picards here and there. but what is losing is yours chance to improve and learn and also increasing a chance of being get hated by other members.

Before releasing something learn the basics you still haven't improved your scripting skills and still calls yourself a "Lead scripter". The irony in them is quite amazing.

Needless to say ,one star from me. Keep trying....
Reply
#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
#19

Quote:
Originally Posted by Yaa
View Post
it matters since you releasing it as a open source. Readability is key factor.

Quote:
Originally Posted by Yaa
View Post
wtf? you even don't understand what i said use char arrays instead of plain.

Quote:
Originally Posted by Yaa
View Post
it's complety fine. i perfer this names
then dont release it keep it to yourself.

Quote:
Originally Posted by Yaa
View Post
Doesn't matter.
Stop scripting.

Quote:
Originally Posted by Yaa
View Post
what wrrong in this again ? it's the most naming used DIALOG_* try to search in scripts please.
Again readability

Quote:
Originally Posted by Yaa
View Post
well. let's go logic
Well start using common sense.

Quote:
Originally Posted by Yaa
View Post
also the most bigs servers uses this functions (xSF, LVP, ...)

etc
That server owners need to get a hit from brick right on the head.use one global array to hold the player name.Learn data structure.At least learn basics.

http://www.hongkiat.com/blog/developer-habits/

Need to say more? Or you have anything to say more?

Just fix this simple code. If you can't even do that stop scripting.
Reply
#20

Quote:
Originally Posted by Yaa
View Post
Doesn't matter.
It does matter. Again, you are using 200 length string for a 70 length string.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)