Jump to content

Leonard

Administrator
  • Posts

    1,303
  • Joined

  • Last visited

  • Days Won

    53

Everything posted by Leonard

  1. Leonard

    [C++] Snake

    player.position[1]--;
  2. Problema a fost rezolvată. Topic închis!
  3. Pentru inceput, ai nevoie de un textdraw pentru a face un speedometru. Pentru a afla viteza unui vehicul, te folosesti de acest stock: stock GetVehicleSpeed(vehicleid) { new Float: velX, Float: velY, Float: velZ; GetVehicleVelocity(vehicleid, velX, velY, velZ); return floatround(((floatsqroot(((velX * velX) + (velY * velY) + (velZ * velZ))) * 170.0)) * 1); } Faci un timer pentru fiecare jucator folosind y_timers: ptask oneSecondPlayerTimer[1000](playerid) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new veh_id = GetPlayerVehicleID(playerid); new speed = GetVehicleSpeed(veh_id); // Iar aici formatezi textdraw-ul pentru speedometru, exemplu: new string[64]; format(string, 64, "%d km/h", speed); PlayerTextDrawSetString(playerid, TextDraw, string); PlayerTextDrawShow(playerid, TextDraw); } return 1; }
  4. Problema a fost rezolvată. Topic închis!
  5. new BizzInfo[23][bInfo]; -> new BizzInfo[100][bInfo];
  6. "Accessing elem ent at index 23 past array upper bound 22" Vad ca ai eroare la LoadBizz, arata functia + variabila principala, aia new bizinfo sau cum ai tu.
  7. pai vad ca tot insista ca vrea gmu xss
  8. Problema a fost rezolvată. Topic închis!
  9. Problema a fost rezolvată. Topic închis!
  10. Problema a fost rezolvată. Topic închis!
  11. ???? ce-i asa de greu sa faci tu o copie?
  12. pt y_commands trebuie sa modifici OnPlayerCommandPerformed OnPlayerCommandPerformed Acum este: e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) Exemplu: public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) { if(success == COMMAND_UNDEFINED) { SendClientMessage(playerid, -1, "Aceasta comanda nu exista."); return COMMAND_OK; } return COMMAND_OK; } Lista cu errorile: enum e_COMMAND_ERRORS { // The majority of these are even - odd numbers return "1" not "0". COMMAND_ZERO_RET = 0 , // The command returned 0. COMMAND_OK = 1 , // Called corectly. COMMAND_UNDEFINED = 2 , // Command doesn't exist. COMMAND_DENIED = 3 , // Can't use the command. COMMAND_HIDDEN = 4 , // Can't use the command don't let them know it exists. COMMAND_NO_PLAYER = 6 , // Used by a player who shouldn't exist. COMMAND_DISABLED = 7 , // All commands are disabled for this player. COMMAND_BAD_PREFIX = 8 , // Used "/" instead of "#", or something similar. COMMAND_INVALID_INPUT = 10, // Didn't type "/something". } Iar la Iteratori, ai inteles gresit cum se folosesc. La comanda ta: YCMD:admins(playerid, params[], help) { new string[128]; foreach(new i: Admin) { if(PlayerInfo[i][pAdmin] > 0) { format(string, 128, "%s - admin level %d", GetName(playerid), PlayerInfo[i][pAdmin]); SendClientMessage(playerid, 0xFFFFFFFF, string); } } return 1; } Functia GetName trebuie sa apeleze ID-ul adminului, nu al tau, iar acea verificare daca e admin, e inutila, pt ca in interator adaugi doar persoanele care au admin. GetName(playerid) -> GetName(i) foreach(new i: Admin) { if(PlayerInfo[i][pAdmin] > 0) { format(string, 128, "%s - admin level %d", GetName(playerid), PlayerInfo[i][pAdmin]); SendClientMessage(playerid, 0xFFFFFFFF, string); } -> foreach(new i: Admin) { format(string, 128, "%s - admin level %d", GetName(i), PlayerInfo[i][pAdmin]); SendClientMessage(playerid, 0xFFFFFFFF, string); }
  13. @Wildo reputatia ti-a fost resetata. @LolyAdv la a II-a abatere, vei fi banat. Reclamatie inchisa.
  14. Sublime Text Theme -> Notepad++ Salut! Sunt utilizator al programului de editare Notepad++ de cativa ani, il folosesc pentru Scripting SAMP, dar prefer tema oferita de Sublime Text. Asadar, am facut niste modificari asupra temei din Notepad++ si am ales sa va las si voua fisierul modificat, pentru cei care vor sa-l foloseasca. Pentru a arata ca in poza, puneti fisierul din link-ul de mai jos in %appdata%\Notepad++ si schimbati tema in Monokai (Settings -> Style Configurator -> Select Theme) Download theme: Click Succes! Tutorial realizat de @Lunoxx
×
×
  • Create New...