Phone and non repeating phone numbers
#1

Hello, how do i check if the phone number is in use while buying a phone? I use MySQL and can't think of a way to check for the players that are offline.Anyone got ideas?
Reply
#2

I'm not sure about that, let's say player1 get's a number 10,it's then stored.Player2 gets a number 11,and he can't get 10because it's stored there. And then the number 11will be stored. Then when player3 buy a phone,won't he be able to get the number 10?
Reply
#3

Oh,you meant that the number should be one after another? Please tell me how do i do that,because i was thinking about using random();
Reply
#4

Ah, as always. Genius of simplicity... I thank you. If you want more of my problems,you know where to find me
Reply
#5

If you don't mind,another question,how do i compare the player numbers with the one that player is calling,because this doesn't seem to work
pawn Код:
if(strcmp(PlayerInfo[i][PhoneNumber],tmp,true,6))
Reply
#6

May I see the full cmd because this seems right except the [i] part.
Reply
#7

Please use the EDIT button. Don't double post!
Reply
#8

pawn Код:
CMD:skambinti(playerid,params[])
{
    new tmp[32];
    if(sscanf(params,"d",tmp)) SendClientMessage(playerid,0xFF0000FF,"Naudojimas /skambinti [Telefono Numeris]");
    else
    {
        foreach(new i:Player)
        {
        if(PlayerInfo[i][PhoneNumber]==tmp)
            {
Heres the command.It's not unfinshed...well i guess you noticed
Reply
#9

About addition...it looks like even that doesn't work, so i got 2 problems now,the one above and this:
pawn Код:
new LastNumber = 350000;
                    PlayerInfo[playerid][PhoneNumber]=LastNumber + 8417;
                    LastNumber = PlayerInfo[playerid][PhoneNumber];
pawn Код:
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(3060) : warning 213: tag mismatch
C:\Users\Justas\Desktop\testserver 0.3x\gamemodes\rp.pwn(3061) : warning 213: tag mismatch
Sorry for the double post,but i needed to refresh this topic anyway because a days has passed
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)