Forum
Search
Members
Help
Hello There, Guest!
Login
Username:
Password:
Lost Password?
Remember me
SA-MP Forums Archive
SA-MP Scripting and Plugins
Scripting Help
Threaded Mode
How to set a ' - ' betwen number phone ? (470-605)
Metharon
Huge Clucker
Posts: 340
Threads: 189
Joined: Apr 2014
Reputation:
0
#1
24.05.2015, 22:08
I want my number to be 417-364
Do somebody have a string function that set a ' - ' between the numbers?
Find
Reply
Bingo
High-roller
Posts: 1,690
Threads: 18
Joined: Jul 2012
Reputation:
0
#2
24.05.2015, 22:12
(
Последний раз редактировалось Bingo; 24.05.2015 в 23:43.
)
DELETE.
Find
Reply
Macluawn
Gangsta
Posts: 613
Threads: 11
Joined: Aug 2010
Reputation:
0
#3
24.05.2015, 23:13
Assuming that all phone numbers are 6 digits long and stored as an integer, you can just use mod and division:
phone / 1000
to get the first 3 digits.
phone % 1000
to get the last 3 digits.
and then you can output them with an delimiter you want.
Or if the length is unknown and you dont want to do any fancy math tricks, look into
strins
.
Find
Reply
Kyle
High-roller
Posts: 2,262
Threads: 260
Joined: Mar 2009
Reputation:
0
#4
24.05.2015, 23:15
strins(string, "-", 3);
Find
Reply
«
Next Oldest
|
Next Newest
»
View a Printable Version
Forum Jump:
Private Messages
User Control Panel
Who's Online
Search
Forum Home
SA-MP
-- News and Updates
-- General
-- Client Support
-- Bug Reports
-- Screenshots and Videos
SA-MP Server
-- Server Support
-- Server Advertisements
SA-MP Scripting and Plugins
-- Scripting Help
---- Tutorials
---- Discussion
---- Help Archive
-- Gamemode Scripts
-- Filterscripts
---- Includes
---- Tools and Files
---- Maps
-- Plugin Development
SA-MP DL Edition
-- SA-MP 0.3.DL
---- Model Releases
Other
-- Everything and Nothing
Non-English
-- Languages
---- Nederlands/Dutch
------ Scripting Showroom en Discussie
------ Off topic
---- Español/Spanish
------ Lanzamientos/Releases
---- Français/French
------ Showroom
---- Русский/Russian
------ Релизы/Releases
---- Português/Portuguese
------ Lançamentos/Releases
---- Română/Romanian
------ Salonul Scripturilor
---- Archive
Users browsing this thread: 1 Guest(s)
SA-MP Forums Archive
SA-MP Scripting and Plugins
Scripting Help