Low signal simulation in a string:
#1

I'm releasing a cellphone system and I've introduced radio towers for the same purpose. Towers have a certain range, and if you're not in the range, the signal will be low. However, I'm not quite sure how I could replace the message the player types with dots and hyphens, for example:

Hey ma.. c.. you hea.. me? Lo.. where I liv...

Could anyone give me a practical example on how to perform this and what functions to use?
Reply
#2

In real life, you don't receive the message in a low signal zone until you get a better signal. I've also done this a while back for my cellphone sys, the "signal bars".
I can only answer your question which functions to use: strfind, strdel and strins.
Reply
#3

This is inefficient but try to do something like this.
pawn Код:
new a = random(3);
    strdel(word, a, random(5));
    strins(word, "...", a);
Instead of the whole text work on each words. And I don't know how to work on each words. Maybe use sscanf() to get all the words and store them separately.
Reply
#4

loop over the string, use random to decide change the str[i] to a .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)