SA-MP Forums Archive
How to create a simple phone system? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to create a simple phone system? (/showthread.php?tid=473066)



How to create a simple phone system? - Spydah - 01.11.2013

Well I'm working on a Prison Script and I'm trying to create a system that you can smuggle phones.
But I can't figure out how to create a good and simple phone system.
Can anyone help me?


Re: How to create a simple phone system? - Tagathron - 01.11.2013

https://sampforum.blast.hk/showthread.php?tid=447813
If you need someone to make it for you.


Re: How to create a simple phone system? - Spydah - 01.11.2013

I want to do it myself so I can learn scripting quicker.


Re: How to create a simple phone system? - Tagathron - 01.11.2013

Basically you could make players have a place to buy phone,like somewhere in the prison,where they could take it.
And then they could sell it to other players,if that's something like your idea?
I mean,where do you want your players to get phones first?


Re: How to create a simple phone system? - Spydah - 01.11.2013

To smuggle it in the prison.
But I need to know how to create the call/sms system, I know how to create a smuggle point etc.
And with random numbers or so.


Re: How to create a simple phone system? - Tagathron - 01.11.2013

Basically,if player has a phone,he would enter a number in the command (/call [NUMBER]) then the player who has that number would recieve a message he is beeing called,and that he needs to pick up to answer (/answer for example).Then whatever the player who called says it would be transfered to the person who answered.

Basically that's just the idea.
And about the random numbers,just make a random number . For example
Код:
new PhoneNum[MAX_PLAYERS]
new randomNumber = random(RANGE OF NUMBERS);
//When a player gets his phone,set the number value to something:
PhoneNum[playerid]=randomNumber;
//Also loop through players,and check if someone already has that number,to avoid bugs,just in case...



Re: How to create a simple phone system? - Spydah - 01.11.2013

Yeah, but I need to know how to write a call/sms system..


Re: How to create a simple phone system? - Spydah - 02.11.2013

I need it for Zcmd, can anyone please help me..

I Need to create a call/sms system + a random phone number combination.


Re: How to create a simple phone system? - JohnRazer - 02.11.2013

Hmm, never done this before but i'm pretty sure I know how to do it. Add a part to your enum that has pHasPhone and pPhoneNumber. If pHasPhone == 1, then make it generate a random number. Add something in OnPlayerText so if IsInACall == 1, then format then SendClientMessage. It shouldn't be too hard, if you need me to whip up a working example just ask.
Edit: I also recommend that you look at existing scripts and learn something from them.


Re: How to create a simple phone system? - Spydah - 03.11.2013

Thanks I'm gonna try.