SA-MP Forums Archive
Phone and non repeating phone numbers - 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: Phone and non repeating phone numbers (/showthread.php?tid=422094)



Phone and non repeating phone numbers - dusk - 12.03.2013

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?


Re: Phone and non repeating phone numbers - dusk - 12.03.2013

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?


Re: Phone and non repeating phone numbers - dusk - 12.03.2013

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();


Re: Phone and non repeating phone numbers - dusk - 12.03.2013

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


Re: Phone and non repeating phone numbers - dusk - 12.03.2013

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))



Re: Phone and non repeating phone numbers - Itzhak E. - 12.03.2013

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


Re: Phone and non repeating phone numbers - MP2 - 12.03.2013

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


Re: Phone and non repeating phone numbers - dusk - 12.03.2013

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


Re: Phone and non repeating phone numbers - dusk - 13.03.2013

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


Re: Phone and non repeating phone numbers - dusk - 16.03.2013

bump