Jump to content

Andrey003

Membru
  • Posts

    31
  • Joined

  • Last visited

Posts posted by Andrey003

  1. [pawn]public OnGameModeInit()
    {
    new HostCommand[128];
    // Change the hostname
    format(HostCommand, 128, "hostname %s", GameModeName);
    SendRconCommand(HostCommand);
     
    GameModeInit_VehiclesPickups(); // Add all static vehicles and pickups when the server starts that are required (also load the houses)
    GameModeInit_Classes(); // Add character models to the class-selection (without weapons)
     
    Convoys_Init(); // Setup textdraws and default data for convoys
     
    ShowPlayerMarkers(1); // Show players on the entire map (and on the radar)
    ShowNameTags(1); // Show player names (and health) above their head
    ManualVehicleEngineAndLights(); // Let the server control the vehicle's engine and lights
    EnableStuntBonusForAll(0); // Disable stunt bonus for all players
    DisableInteriorEnterExits(); // Removes all building-entrances in the game
    UsePlayerPedAnims(); // Use CJ's walking animation
     
    // Start the timer that will show timed messages every 2 minutes
    SetTimer("Timer_TimedMessages", 1000 * 60 * 2, true);
    // Start the timer that will show a random bonus mission for truckers every 5 minutes
    SetTimer("ShowRandomBonusMission", 1000 * 60 * 5, true);
    // Start the timer that checks the toll-gates
    SetTimer("Toll", 1000, true);
     
    // Fix the bugged houses (after fixing the houses, you can remove this line, as it's not needed anymore)
    FixHouses();
     
    // While the gamemode starts, start the global timer, and run it every second
    SetTimer("GlobalTimer", 1000, true);
    return 1;
    }[/pawn]
     
    [pawn]// Always allow NPC's to login without password or account
     
    if (IsPlayerNPC(playerid))
      return 1;
     
    // Setup local variables
    new Name[MAX_PLAYER_NAME], NewPlayerMsg[128], HouseID;
     
    // Setup a PVar to allow cross-script money-transfers (only from filterscript to this mainscript) and scorepoints
    SetPVarInt(playerid, "PVarMoney", 0);
    SetPVarInt(playerid, "PVarScore", 0);
     
    // Get the playername
    GetPlayerName(playerid, Name, sizeof(Name));
    // Also store this name for the player
    GetPlayerName(playerid, APlayerData[playerid][PlayerName], 24);
     
    // Send a message to all players to let them know somebody else joined the server
    format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid);
    SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);
     
    // Try to load the player's datafile ("PlayerFile_Load" returns "1" is the file has been read, "0" when the file cannot be read)
    if (PlayerFile_Load(playerid) == 1)
    {
    // Check if the player is still banned
    if (APlayerData[playerid][banTime] < gettime()) // Player ban-time is passed
    ShowPlayerDialog(playerid, DialogLogin, DIALOG_STYLE_INPUT, TXT_DialogLoginTitle, TXT_DialogLoginMsg, TXT_DialogLoginButton1, TXT_DialogButtonCancel);
    else // Player is still banned
    {
    ShowRemainingBanTime(playerid); // Show the remaining ban-time to the player is days, hours, minutes, seconds
    Kick(playerid); // Kick the player
    }
    }
    else
    ShowPlayerDialog(playerid, DialogRegister, DIALOG_STYLE_INPUT, TXT_DialogRegisterTitle, TXT_DialogRegisterMsg, TXT_DialogRegisterButton1, TXT_DialogButtonCancel);
     
    // The houses have been loaded but not the cars, so load all vehicles assigned to the player's houses
    for (new HouseSlot; HouseSlot < MAX_HOUSESPERPLAYER; HouseSlot++)
    {
       // Get the HouseID from this slot
       HouseID = APlayerData[playerid][Houses][HouseSlot];
       // Check if there is a house in this slot
    if (HouseID != 0)
       HouseFile_Load(HouseID, true); // Load the cars of the house
    }
     
     // Speedometer setup
    Speedometer_Setup(playerid);
     
    // MissionText TextDraw setup
    APlayerData[playerid][MissionText] = TextDrawCreate(320.0, 430.0, " "); // Setup the missiontext at the bottom of the screen
    TextDrawAlignment(APlayerData[playerid][MissionText], 2); // Align the missiontext to the center
    TextDrawUseBox(APlayerData[playerid][MissionText], 1); // Set the missiontext to display inside a box
    TextDrawBoxColor(APlayerData[playerid][MissionText], 0x00000066); // Set the box color of the missiontext
    TextDrawFont(APlayerData[playerid][MissionText], 1);//set stilu de scris text
     
    // Display a message if the player hasn't accepted the rules yet
    if (APlayerData[playerid][RulesRead] == false)
      SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Nu Ai Acceptat {FFFF00}/rules{FF0000}");

    // This function shows the player how long his ban still is when he tries to login (in days, hours, minutes, seconds)
    ShowRemainingBanTime(playerid)
    {
    // Setup local variables
    new TotalBanTime, Days, Hours, Minutes, Seconds, Msg[128];
     
    // Get the total ban-time
    TotalBanTime = APlayerData[playerid][banTime] - gettime();
     
    // Calculate days
    if (TotalBanTime >= 86400)
    {
    Days = TotalBanTime / 86400;
    TotalBanTime = TotalBanTime - (Days * 86400);
    }
    // Calculate hours
    if (TotalBanTime >= 3600)
    {
    Hours = TotalBanTime / 3600;
    TotalBanTime = TotalBanTime - (Hours * 3600);
    }
    // Calculate minutes
    if (TotalBanTime >= 60)
    {
    Minutes = TotalBanTime / 60;
    TotalBanTime = TotalBanTime - (Minutes * 60);
    }
    // Calculate seconds
    Seconds = TotalBanTime;
     
    // Display the remaining ban-time for this player
    SendClientMessage(playerid, 0xFFFFFFFF, TXT_StillBanned);
    format(Msg, 128, TXT_BannedDuration, Days, Hours, Minutes, Seconds);
    SendClientMessage(playerid, 0xFFFFFFFF, Msg);
    }
    [/pawn]
     
    am scos de la onplayerconect niste RemoveBuildingForPlayer dar nu cred ca are vreo treaba

  2. Problemă întâlnită (descriere): Can dau /restart la server scrie restart in 2 minute ,iar dupa ce isi da restart incep niste textdraw sa dispara si sa apara cu o locatie "Blueberry ..."
    Ero(area / rile) / warning-(ul / urile): -
    Liniile de cod / sursa / script-ul:
    [pawn]
    COMMAND:restart(playerid, params[])
    {
    // Send the command to all admins so they can see it
    SendAdminText(playerid, "/restart", params);

    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
    // Check if the player's admin-level is at least 7
    if (APlayerData[playerid][PlayerLevel] >= 7)
    {

    // Let everyone know that the server will be restarted in 2 minutes
    GameTextForAll("Restart server in 2 minute!", 5000, 3);
    SendClientMessageToAll(0xA0A0A0, "Restart server in 2-a minute!");
    // Start the next timer which warns the players again that server will be restarted in 1 minute
    SetTimer("Timer_Restart_WarnPlayers", 1000 * 60, false);
    }
    else
       return 0;
    }
    else
       return 0;

    // Let the server know that this was a valid command
    return 1;
    }

    forward Timer_Restart_WarnPlayers();
    public Timer_Restart_WarnPlayers()
    {
    // Let everyone know that the server will be restarted in 1 minutes

    GameTextForAll("Restart server intr-un minut!", 5000, 3);

    SendClientMessageToAll(0xA0A0A0, "Restart server intr-un minut!");

    // Start the next timer

    SetTimer("Timer_Restart_Kick", 1000 * 60, false);

    // Change the hostname of the server and it's password

    SendRconCommand("hostname Pending Restart");


    return 1;

    }

    forward Timer_Restart_Kick();

    public Timer_Restart_Kick()
    {

    // Let everyone know that the server is kicking all players before restarting

    GameTextForAll("Server restarting:Reconect!", 5000, 3);

    // Kick all players

    for(new i; i < MAX_PLAYERS; i++)
    Kick(i);

    // Start the next timer that will restart the server

    SetTimer("Timer_Restart_Reboot", 1000 * 5, false);
    return 1;
    }

    forward Timer_Restart_Reboot();
    public Timer_Restart_Reboot()
    {
    // Restart the server
    SendRconCommand("gmx");
    return 1;
    }
    [/pawn]

    Imagini / Video (optional):
    http://imgur.com/Wx1JUHf,f2MsZJq,EG48X8Z#0 - cand dau restart
    http://imgur.com/Wx1JUHf,f2MsZJq,EG48X8Z#2 -dupa ce dau restart acele texte de sus , jos ,si alea din dreapta tot dispar si apar
    Aţi încercat să rezolvaţi singur?: nu stiu cum

  3. Problemă întâlnită (descriere): Cand dau /restart spune "server restart in 2 minute" si dupa doua minute se inchide sv si consola nu se restarteaza ... cum pot rezolva
    Ero(area / rile) / warning-(ul / urile): - 
    Liniile de cod / sursa / script-ul:

    [pawn]

    COMMAND:restart(playerid, params[])

     
    {
     
    // Send the command to all admins so they can see it
     
    SendAdminText(playerid, "/restart", params);
     
     
     
    // Check if the player has logged in
     
    if (APlayerData[playerid][LoggedIn] == true)
     
    {
     
    // Check if the player's admin-level is at least 7
     
    if (APlayerData[playerid][PlayerLevel] >= 7)
     
    {
     
    // Let everyone know that the server will be restarted in 2 minutes
     
    GameTextForAll("Restart server in 2 minute!", 5000, 3);
     
    SendClientMessageToAll(0xA0A0A0, "Restart server in 2-a minute!");
     
    // Start the next timer which warns the players again that server will be restarted in 1 minute
     
    SetTimer("Timer_Restart_WarnPlayers", 1000 * 60, false);
     
    }
     
    else
     
       return 0;
     
    }
     
    else
     
       return 0;
     
     
     
    // Let the server know that this was a valid command
     
    return 1;
     
    }
     
    forward Timer_Restart_WarnPlayers();
     
    public Timer_Restart_WarnPlayers()
     
    {
     
    // Let everyone know that the server will be restarted in 1 minutes
     
    GameTextForAll("Restart server intr-un minut!", 5000, 3);
     
    SendClientMessageToAll(0xA0A0A0, "Restart server intr-un minut!");
     
    // Start the next timer
     
    SetTimer("Timer_Restart_Kick", 1000 * 60, false);
     
    // Change the hostname of the server and it's password
     
    SendRconCommand("hostname Pending Restart");
     
    SendRconCommand("password 123");
     
     
     
    return 1;
     
    }
     
    forward Timer_Restart_Kick();
     
    public Timer_Restart_Kick()
     
    {
     
    // Let everyone know that the server is kicking all players before restarting
     
    GameTextForAll("Server restarting:Reconect!", 5000, 3);
     
    // Kick all players
     
    for(new i; i < MAX_PLAYERS; i++)
     
    Kick(i);
     
    // Start the next timer that will restart the server
     
    SetTimer("Timer_Restart_Reboot", 1000 * 5, false);
     
     
     
    return 1;
     
    }
     
    forward Timer_Restart_Reboot();
     
    public Timer_Restart_Reboot()
     
    {
     
    // Restart the server
     
    SendRconCommand("exit");
     
    return 1;
     
    }
     

    [/pawn]

    Imagini / Video (optional):-
    Aţi încercat să rezolvaţi singur?: nu stiu cum

  4. Acum imi apar aceste warninguri 

    [pawn]
    (175) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
    (176) : warning 202: number of arguments does not match definition
    (176) : warning 202: number of arguments does not match definition
    (177) : warning 213: tag mismatch
    (175) : warning 204: symbol is assigned a value that is never used: "PlayerName"
    [/pawn]
     
    am incercat sa intru in server si scrie jos y a intrat pe server iar apoi ma scoate si se inchide sever-ul,,,iar login la inceput nu mai apare ..
     
    si ti-am spus ca eu am niste texte definite alea nu ar trebui sa fie adaugate aici?
  5. erorile

    [pawn]

    (175) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
    (176) : error 035: argument type mismatch (argument 2)
    (177) : warning 213: tag mismatch
    (175) : warning 204: symbol is assigned a value that is never used: "PlayerName"
    [/pawn]
     
    1. liniile
    2. (175)  new String[64], PlayerName[MAX_PLAYER_NAME];
    3. (176)  GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    4. (177)  format(String, sizeof(String), "%s a intrat pe server", PlayerName);
  6. Am facut tot ce mi-ai zis si am aceste errori

    [pawn]
    (175) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
    (176) : error 035: argument type mismatch (argument 2)
    (177) : warning 213: tag mismatch
    (175) : warning 204: symbol is assigned a value that is never used: "PlayerName"
    (622) : warning 219: local variable "PlayerName" shadows a variable at a preceding level
    (623) : error 035: argument type mismatch (argument 2)
    (624) : warning 213: tag mismatch
    (622) : warning 204: symbol is assigned a value that is never used: "PlayerName"
    [/pawn]
     
    si liniile
    [pawn]
    (175)    new String[64], PlayerName[MAX_PLAYER_NAME];
    (176)    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    (177)    format(String, sizeof(String), "%s a intrat pe server", PlayerName);
    (622)    new String[64], PlayerName[MAX_PLAYER_NAME];
    (623)    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    (624)    format(String, sizeof(String), "%s a intrat pe server", PlayerName);
    (625)    TextDrawSetString(PlayerJoinedServerTextDraw, String
    [/pawn]
     
    si uite cum imi apare in consola 
    La conectare:
    [pawn]
    format(NewPlayerMsg, 128, TXT_PlayerJoinedServer, Name, playerid);
    SendClientMessageToAll(0xFFFFFFFF, NewPlayerMsg);
    [/pawn]
    La deconectare:
    [pawn]
    format(Msg, 128, TXT_PlayerLeftServer, Name, playerid);
    SendClientMessageToAll(0xFFFFFFFF, Msg);

    [/pawn]

     

    asa imi aparea inainte ....

  7. Descriere tutorial: Am un serve cu gm PPC_Trucking si de cateva zile incerc sa ii pun un textdraw care sa arate playerii care intra si care ies de pe server.

    In PPC_DefTexts am definite TXT_PlayerJoinedServer si TXT_PlayerLeaveServer - astea sunt textele

    Vreau un tutorial cum pot aduga acel texdraw..daca se poate sa apara maxim 3 randuri si sa fie in box

  8. deci am pus la enum asta

    •  
    • new Text:PlayerJoinedServerTextDraw[MAX_PLAYERS]

    iar in loc de asta 

    [pawn]APlayerData[playerid][TXT_PlayerJoinedServer] = TextDrawCreate(250.0, 426.0, " ");
    TextDrawAlignment(APlayerData[playerid][TXT_PlayerJoinedServer], 2);
    TextDrawUseBox(APlayerData[playerid][TXT_PlayerJoinedServer], 1);
    TextDrawBoxColor(APlayerData[playerid][TXT_PlayerJoinedServer], 0x00000066);
    TextDrawFont(APlayerData[playerid][TXT_PlayerJoinedServer], 0);
    [/pawn] 
    am pus doar
    [pawn]APlayerData[playerid][TXT_PlayerJoinedServer];[/pawn]

     

    iar acum am erorile astea :

    (228) : error 001: expected token: "-string end-", but found "-identifier-"
    (228) : warning 215: expression has no effect
     
    si linia 228 este:
    [pawn]APlayerData[playerid][TXT_PlayerJoinedServer];[/pawn]
  9. errorile:
    (227) : error 001: expected token: "-string end-", but found "-identifier-"
    (227) : warning 213: tag mismatch
    (228) : error 001: expected token: "-string end-", but found "-identifier-"
    (229) : error 001: expected token: "-string end-", but found "-identifier-"
    (230) : error 001: expected token: "-string end-", but found "-identifier-"
    (231) : error 001: expected token: "-string end-", but found "-identifier-"
     
    liniile:sunt cele de mai sus de la 227 pana la 231
  10. Problemă întâlnită (descriere): Nu merge sa pun Textdraw la join/leave pe server am gm PPC_Trucking
    Ero(area / rile) / warning-(ul / urile):

    [pawn]error 001: expected token: "-string end-", but found "-identifier-"
    warning 213: tag mismatch
    error 001: expected token: "-string end-", but found "-identifier-"
    expected token: "-string end-", but found "-identifier-"
    expected token: "-string end-", but found "-identifier-"
    error 001: expected token: "-string end-", but found "-identifier-"[/pawn]

    Liniile de cod / sursa / script-ul: asta am in gm pentru join si apare in consola 

    [pawn]APlayerData[playerid][TXT_PlayerJoinedServer] = TextDrawCreate(250.0, 426.0, " ");
    TextDrawAlignment(APlayerData[playerid][TXT_PlayerJoinedServer], 2);
    TextDrawUseBox(APlayerData[playerid][TXT_PlayerJoinedServer], 1);
    TextDrawBoxColor(APlayerData[playerid][TXT_PlayerJoinedServer], 0x00000066);
    TextDrawFont(APlayerData[playerid][TXT_PlayerJoinedServer], 0);[/pawn]

     

    Imagini / Video (optional): -
    Aţi încercat să rezolvaţi singur?: nu stiu cum

  11. Problemă întâlnită (descriere): am reusit sa pun tag-urile dar cand scriu pe chat imi apare doar cu o culoare iar eu in gm am cate o culoare pentru fiecare clasa
    Ero(area / rile) / warning-(ul / urile):-
    Liniile de cod / sursa / script-ul:-
    Imagini / Video (optional): -
    Aţi încercat să rezolvaţi singur?: da am pus culorile 

    ProxDetector(20.0, playerid, string, ColorClassTruckDriver, ColorClassBusDriver, ColorClassPilot, ColorClassPolice, ColorClassFBY, ColorClassMafia, ColorClassCourier, ColorClassAssistance, ColorClassRoadWorker, ColorClassMedic, ColorClassPboy, ColorClassSofer, ColorClassG, ColorClassMarinar, ColorClassTaxi, ColorClassPadurar);

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