Jump to content

CRISS

Membru
  • Posts

    32
  • Joined

  • Last visited

    Never

Posts posted by CRISS

  1. Nume: CRISS

    Nume tutorial: Scapare Lag server SAMP HOSTAT !

    Descriere: De cand am deschis serverul meu de samp pe host(acum cateva zile) am un lag imens pe server...playerii apar uneori AFK, se blocheaza serverul la /rac, pe unii ii scoate de pe server cu mesajul acela "Lost Connection to the Server. Retrying...", e un lag foarte mare, si nu stiu cum sa scap de el. Va rog mult sa ma ajutati. Va multumesc anticipat.

  2. De cand mi-am deschis serverul de SAMP pe host(acum cateva zile) este lag intr-una..playerii apar de mai multe ori AFK(toti) si dureaza 5 sec pana isi revine, se blocheaza uneori la /rac, numai merge bine chatul(scrii cv si dureaza 10+ sec pana apare in chat), este lag fff mare; si daca dau restart dupa aprox 1 ora iar incepe..Va rog mult sa ma ajutati ! Multumesc anticipat !

  3. Wow wow wow stati putin cu setarile...serverul il vezi on in lista de servere la SAMP nu? Si ti se inchide serverul(acea consola) automat cand intri pe el? 80% ca problema este urmatoarea: serverul ruleaza pe MySQL si tu nu ai baza de date..atunci logic ca nu are unde se salva si de unde se citi conturile...(Aceasta este parerea mea cel putin). Astept un reply daca aceasta este sau nu problema.

  4. Uite aici:

    [pawn]if(strcmp(cmd, "/skinrange", true) == 0)

    {

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] >= 1) // sa fie doar pentru admini

        {

            new dist; // variabila pentru distanta

      tmp = strtok(cmdtext, idx);

    dist = strval(tmp);

    if(dist < 1)

    {

        SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: {FFFFFF}/skinrange [range] [skin]");

        return 1;

    }

    if(dist > 100) // distanta maxima sa fie de 100m

    {

    SendClientMessage(playerid, COLOR_LIGHTRED, "* Distanta maxima este de 100 metri !");

    return 1;

    }

    new skin; // variabila pt skin

    tmp = strtok(cmdtext, idx);

    skin = strval(tmp);

    new acpl; // variabila pentru numaratoare

    GetPlayerName(playerid, sendername, sizeof(sendername)); // aflarea numelui care executa comanda

    for(new [censured by the system] = 0; [censured by the system] < MAX_PLAYERS; [censured by the system]++)

    {

        acpl++;

        new Float:x,Float:y,Float:z;

        GetPlayerPos(playerid, x,y,z);

        if(PlayerToPoint(dist, [censured by the system],x,y,z))

        {

            SetPlayerSkin([censured by the system], skin);

            format(string, sizeof(string), "[skinRange]: Admin %s ti'a setat skin'ul cu ID %d", sendername, skin);

            SendClientMessage([censured by the system], COLOR_WHITE, string);

    }

    }

    format(string, sizeof(string), "AdmInfo: {FFFFFF}Admin %s a folosit comanda /skinrange(actionata pe %d playeri).", sendername, acpl);

    ABroadCast(COLOR_LIGHTRED, string, 1);

    }

    else

    {

        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Error: {FFFFFF}Nu esti autorizat sa folosesti aceasta comanda !");

        return 1;

    }

    }

    return 1;

    }[/pawn]

    Sper sa'ti foloseasca ! Succes !

  5. Incearca asa:

    [pawn]public OnPlayerCommandText(playerid, cmdtext[])

    {

    if(strcmp("/radioinfo", cmdtext, true, 10) == 0)

    {

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "~=~=~=~=~=~=~=~=~=~= Radio Information [RO] ~=~=~=~=~=~=~=~=~=~=");

    SendClientMessage(playerid, COLOR_WHITE, "Daca vrei sa asculti radio, scrie /radioon");

    SendClientMessage(playerid, COLOR_WHITE, "Daca vrei sa opresti radio, scrie /radiooff");

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "~=~=~=~=~=~=~=~=~=~= Radio Information [ENG] ~=~=~=~=~=~=~=~=~=~=");

    SendClientMessage(playerid, COLOR_WHITE, "If you want to listen radio, type /radioon");

    SendClientMessage(playerid, COLOR_WHITE, "If you want to stop radio, type /radiooff");

    return 1;

    }

    if (strcmp("/radiooff", cmdtext, true, 10) == 0)

    {

    StopAudioStreamForPlayer(playerid);

    SendClientMessage(playerid, 0xAA3333AA, "RO:  Ai oprit radioul.");

    SendClientMessage(playerid, 0xAA3333AA, "ENG: You have stopped the radio.");

    return 1;

    }

    if (strcmp("/radioon", cmdtext, true) == 0)

    {

    PlayAudioStreamForPlayer(playerid, "http://stream.playmusicfm.info:9000/");

    SendClientMessage(playerid, 0xFFFFFFAA, "Type /Radio off to stop audio streaming.");

    return 1;

    }

    return 0;

    }[/pawn]

    Acele if'uri si parantezele " { " sau " } " trebe sa fie alianite corect, una sub alta..deci ai grija la TAB'uri.

  6. Uite aici o comanda /arrest care functioneaza:

    [pawn]if(strcmp(cmd, "/arrest", true) == 0)

    {

        if(IsPlayerConnected(playerid))

      {

    if(gTeam[playerid] == 2  || IsACop(playerid))

    {

    if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not on Duty!");

        return 1;

    }

            if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391))

    {// Jail spot

        SendClientMessage(playerid, COLOR_GREY, "  You are not near the Jail, can not Arrest !");

        return 1;

    }

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))

    {

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");

    return 1;

    }

    moneys = strval(tmp);

    if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "  Jail Price can not be below $1 or above $99999 !"); return 1; }

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))

    {

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");

    return 1;

    }

    new time = strval(tmp);

    if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, "  Jail Time Minutes can not be below 1 or above 20 (Take the person to prison then) !"); return 1; }

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))

    {

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");

    return 1;

    }

    new bail = strval(tmp);

    if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "  Jail Bailing can not be below 0 or above 1 !"); return 1; }

    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))

    {

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");

    return 1;

    }

    new bailprice = strval(tmp);

    if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "  Jail Bailing can not be below $0 or above $3000000 !"); return 1; }

    new suspect = GetClosestPlayer(playerid);

    if(IsPlayerConnected(suspect))

    {

    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)

    {

    GetPlayerName(suspect, giveplayer, sizeof(giveplayer));

    GetPlayerName(playerid, sendername, sizeof(sendername));

    if(WantedLevel[suspect] < 1)

    {

        SendClientMessage(playerid, COLOR_GREY, "  Player must be at least Wanted Level 1 !");

        return 1;

    }

    format(string, sizeof(string), "* You arrested %s !", giveplayer);

    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

    GivePlayerMoney(suspect, -moneys);

    format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);

    GameTextForPlayer(suspect, string, 5000, 5);

    ResetPlayerWeapons(suspect);

    if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)

    {

    format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);

    OOCNews(COLOR_LIGHTRED, string);

    }

    else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)

    {

    format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);

    OOCNews(COLOR_LIGHTRED, string);

    }

    else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)

    {

    format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);

    OOCNews(COLOR_LIGHTRED, string);

    }

    SetPlayerInterior(suspect, 6);

    SetPlayerPos(suspect,264.6288,77.5742,1001.0391);

    PlayerInfo[suspect][pJailTime] = time * 60;

    if(bail == 1)

    {

    JailPrice[suspect] = bailprice;

    format(string, sizeof(string), "You are jailed for %d seconds.  Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);

    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);

    }

    else

    {

        JailPrice[suspect] = 0;

    format(string, sizeof(string), "You are jailed for %d seconds.  Bail: Unable", PlayerInfo[suspect][pJailTime]);

    SendClientMessage(suspect, COLOR_LIGHTBLUE, string);

    }

    PlayerInfo[suspect][pJailed] = 1;

            PlayerInfo[suspect][pArrested] += 1;

    SetPlayerFree(suspect,playerid, "Got Arrested");

    WantedPoints[suspect] = 0;

    WantedLevel[suspect] = 0;

    WantLawyer[suspect] = 1;

    }//distance

    }//not connected

    else

    {

        SendClientMessage(playerid, COLOR_GREY, "  No-one close enough to arrest.");

        return 1;

    }

    }

    else

    {

        SendClientMessage(playerid, COLOR_GREY, "  You are not a Cop / FBI / National Guard !");

        return 1;

    }

    }//not connected

    return 1;

    }[/pawn]

  7. Comanda /wanted:

    [pawn]if(strcmp(cmd, "/wanted", true) == 0)

    {

        if(IsPlayerConnected(playerid))

      {

    if(gTeam[playerid] == 2 || IsACop(playerid))

    {

    new x;

    SendClientMessage(playerid, COLOR_GREEN, "Current Wanted Suspects:");

        for(new i=0; i < MAX_PLAYERS; i++) {

    if(IsPlayerConnected(i))

    {

        if(WantedLevel > 1)

        {

    GetPlayerName(i, giveplayer, sizeof(giveplayer));

    format(string, sizeof(string), "%s%s: %d", string,giveplayer,WantedLevel);

    x++;

    if(x > 3) {

        SendClientMessage(playerid, COLOR_YELLOW, string);

        x = 0;

    format(string, sizeof(string), "");

    } else {

    format(string, sizeof(string), "%s, ", string);

    }

    }

    }

    }

    if(x <= 3 && x > 0) {

    string[strlen(string)-2] = '.';

        SendClientMessage(playerid, COLOR_YELLOW, string);

    }

    }

    else

    {

        SendClientMessage(playerid, COLOR_GREY, "  You're not a Cop / FBI / National Guard !");

    }

    }//not connected

    return 1;

    }[/pawn]

  8. Banii la PayDay sunt dati in functie de variabila "PlayerInfo[pPayCheck]" , deci cauta in gamemode liniile unde se seteaza "pPayCheck" la playeri si modifica de acolo.

    Culorile membrilor de la factiuni:

    Folosesti functia

    [pawn]SetPlayerToTeamColor(playerid, )[/pawn]

    Daca ai un public se parat, cum ar fi "public SetPlayerToTeamColor", pui acolo functia aceasta. Daca nu, o pui sub "public OnPlayerSpawn".

    Cu aceasta functie, setezi la fiecare factiune culoarea membrilor. De ex:

    [pawn]if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)

    {

    SetPlayerToTeamColor(playerid, );

    }

    else if.....[/pawn]

    Si faci tot asa pt toate factiunile dorite.

×
×
  • 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.