strins
#1

I'm thinking its because it's so damn late, but I need some help with this.

Currently, what I have is a phone system that I'm trying to get to work.

Here are the variables:
pawn Код:
new
            cellDialedNumber [ MAX_PLAYERS ] [ 30 ],
            cellDialStage [ MAX_PLAYERS ] = 9;
Now, the original string is "000000000", I'm trying to insert the number they hit next in line. Like say they hit 1;

"000000000" would turn into "000000001", and if they hit 1 again (or any other number for that matter), it would turn into "000000011", and so on. How would I go about doing this?

I've attempted, but I'm figuring it's too late because I can't seem to get it working.

pawn Код:
if(clickedid == DialPadOne )
        {
            new s[128]; // Testing string.
            strdel( cellDialedNumber [ playerid ], 9, 10 );
            strins( cellDialedNumber [ playerid ], "1", cellDialStage [ playerid ] );
            format(s, 128, "%s", cellDialedNumber [ playerid ] ); // Testing.
            SendClientMessage( playerid, -1, s); // Testing.
            SendClientMessage( playerid, -1, "One" ); // Testing.
           
            cellDialStage [ playerid ] -= 1;
        }
What am I doing wrong?
Reply


Messages In This Thread
strins - by 2KY - 30.08.2012, 05:07
Re: strins - by [ABK]Antonio - 30.08.2012, 05:38
Re: strins - by 2KY - 30.08.2012, 17:22
Re: strins - by mamorunl - 30.08.2012, 17:39
Re: strins - by 2KY - 30.08.2012, 17:42

Forum Jump:


Users browsing this thread: 1 Guest(s)