Jump to content

/call pe zcmd


Jimmi

Recommended Posts

Am zis sa incerc sa trec comanda /call pe zcmd.dadea multe chesti nedefinite si am adaugat 5 6 new-uri dar tot da eroare...

CMD:call(playerid,params[])
    {
        new tmp[1024];
        new cmdtext[124];
        new sendername[36];
        new idx;
        new string[256]
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /call [numar]");
                return 1;
            }
            if(PlayerInfo[playerid][pPnumber] == 0)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Nu ai un telefon !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "* %s scoate un telefon.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            new phonenumb = strval(tmp);
            SetPlayerAttachedObject(playerid, 1, 330 , 6);
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
            if(phonenumb == 911)
            {
                SendClientMessage(playerid, COLOR_WHITE, "INDICIU: Foloseste tasta T pentru a vorbi la telefon, scrie /hangup pentru a inchide.");
                SendClientMessage(playerid, COLOR_ALLDEPT, "URGENTE: Ce departament cautati, Politia sau Fireman/Paramedic?");
                Mobile[playerid] = 911;
                return 1;
            }
            if(phonenumb == PlayerInfo[playerid][pPnumber])
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Numar ocupat!");
                Mobile[playerid] = 255;
                return 1;
            }
            if(Mobile[playerid] != 255)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Deja esti intr-un apel..");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] >= 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti vorbi, ai mute!");
                return 1;
            }
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                    {
                        giveplayerid = i;
                        Mobile[playerid] = giveplayerid; //caller connecting
                        if(IsPlayerConnected(giveplayerid))
                        {
                            if(giveplayerid != INVALID_PLAYER_ID)
                            {
                                if(PhoneOnline[giveplayerid] > 0)
                                {
                                    SendClientMessage(playerid, COLOR_GREY, "   Acel jucator are telefonul inchis !");
                                    return 1;
                                }
                                if (Mobile[giveplayerid] == 255)
                                {
                                    if(IsAtPublicPhone(playerid)) TogglePlayerControllable(playerid, 0);
                                    if(PlayerInfo[playerid][pDonateRank] == 1) { format(string, sizeof(string), "Telefonul tau suna - Apelant: %s", sendername); }
                                    else format(string, sizeof(string), "Telefonul tau suna.");
                                    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
                                    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
                                    RingTone[giveplayerid] = 10;
                                    format(string, sizeof(string), "* Telefonul lui %s incepe sa sune.", sendername);
                                    //SendClientMessage(playerid, COLOR_WHITE, "HINT: You now use T to talk on your cellphone, type /hangup to hang up");
                                    ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    CellTime[playerid] = 1;
                                    return 1;
                                }
                            }
                        }
                    }
                }
            }
            SendClientMessage(playerid, COLOR_GRAD2, "  Numar ocupat!");
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
            RemovePlayerAttachedObject(playerid, 1);
        }
        return 1;
 }

 

Nici nu stiu daca am trecut comanda corect pe zcmd...

Link to comment
Share on other sites

  • WopsS locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.