код репаира кара если можно
ну так перенеси из собейта. В чем твоя проблема?Есть у кого-нибудь адрес onfoot рейтов для r3 сампа? Нашел в собейте, но в апи лучара нету
Я нашел собейт только для r1 версии сампану так перенеси из собейта. В чем твоя проблема?
как работает этот плагин? как-то очищает буфер при каждом реконнекте?Reset remove building count
Убирает краш, связанный с переполнением буфера RPC_ScrRemoveBuildingForPlayer, при частых переподключениях.www.blast.hk
void __cdecl __noreturn patch()
{
HMODULE sampaddr; // esi
DWORD prot; // [esp-8h] [ebp-20h]
DWORD flOldProtect; // [esp+Ch] [ebp-Ch] BYREF
DWORD flNewProtect; // [esp+10h] [ebp-8h] BYREF
for ( sampaddr = GetModuleHandleA("samp.dll"); !sampaddr; sampaddr = GetModuleHandleA("samp.dll") )
Sleep(1000u);
VirtualProtect((LPVOID)0x7BA917, 0xDu, 0x40u, &flOldProtect);
MEMORY[0x7BA917] = '%\x83';
MEMORY[0x7BA919] = sampaddr + '\x04\xEEV';
MEMORY[0x7BA91D] = '\xC5\x8E\x8B\0';
MEMORY[0x7BA921] = '\x03';
MEMORY[0x7BA923] = '\0';
VirtualProtect((LPVOID)0x7BA917, 2u, flOldProtect, 0);
VirtualProtect((LPVOID)0x7BA924, 5u, 0x40u, &flNewProtect);
MEMORY[0x7BA925] = (char *)sampaddr + 0xFF84F80E;
MEMORY[0x7BA924] = '\xE9';
VirtualProtect((LPVOID)0x7BA924, 5u, flNewProtect, 0);
VirtualProtect((char *)sampaddr + 0xA131, 6u, 0x40u, &flNewProtect);
prot = flNewProtect;
*((_BYTE *)sampaddr + 0xA131) = '\xE9';
*(_DWORD *)((char *)sampaddr + 0xA132) = 0x7BA912 - ((_DWORD)sampaddr + 0xA131);
*((_BYTE *)sampaddr + 0xA136) = '\x90';
VirtualProtect((char *)sampaddr + 0xA131, 6u, prot, 0);
FreeLibraryAndExitThread(hLibModule, 0);
}
Посмотри реализацию односвязного списка, сразу всё поймёшь.есть структура данных типа стек, нужно заполнить его целыми числами до n-го, вывести, вырезать чётные элементы, и опять вывести.
не смог найти годных статей, потому обращаюсь сюда, был бы благодарен за помощь.
есть структура данных типа стек, нужно заполнить его целыми числами до n-го, вывести, вырезать чётные элементы, и опять вывести.
не смог найти годных статей, потому обращаюсь сюда, был бы благодарен за помощь.
C++:struct stack { int data; stack* next; };
#include <bits/stdc++.h>
using namespace std;
#define MAX 10
class Stack {
int top;
public:
int a[MAX];
Stack() { top = -1; }
bool push(int x);
int pop();
int peek();
bool isEmpty();
};
bool Stack::push(int x)
{
if (top >= (MAX - 1)) {
return false;
}
else {
a[++top] = x;
cout << "push " << x << "\n";
return true;
}
}
int Stack::pop()
{
if (top < 0) {
return 0;
}
else {
int x = a[top--];
return x;
}
}
int Stack::peek()
{
if (top < 0) {
return 0;
}
else {
int x = a[top];
return x;
}
}
bool Stack::isEmpty()
{
return (top < 0);
}
int main()
{
class Stack stackInst;
// заполняем стак
for(size_t i = 0; i < MAX; i++)
{
stackInst.push(i);
}
// избавляемся от четных элементов стака
class Stack stackBuffer;
while (!stackInst.isEmpty())
{
int val = stackInst.peek();
stackInst.pop();
if (val % 2 == 1)
stackBuffer.push(val);
}
while (!stackBuffer.isEmpty())
{
stackInst.push(stackBuffer.peek());
stackBuffer.pop();
}
// стак на выходе
cout << "current stack data: ";
while(!stackInst.isEmpty())
{
cout<<stackInst.peek()<<" ";
stackInst.pop();
}
return 0;
}
/*
output:
push 0
push 1
push 2
push 3
push 4
push 5
push 6
push 7
push 8
push 9
push 9
push 7
push 5
push 3
push 1
push 1
push 3
push 5
push 7
push 9
current stack data: 9 7 5 3 1
*/
это не стек, а linked liststruct stack { int data; stack* next; };
Что это за треш, думаю не стоит приводить в пример такую ебанутую реализациючтобы не мучать голову со своим классом стака(если не требуется создавать его самому) - то используй std::stackstack imp:#include <bits/stdc++.h> using namespace std; #define MAX 10 class Stack { int top; public: int a[MAX]; Stack() { top = -1; } bool push(int x); int pop(); int peek(); bool isEmpty(); }; bool Stack::push(int x) { if (top >= (MAX - 1)) { return false; } else { a[++top] = x; cout << "push " << x << "\n"; return true; } } int Stack::pop() { if (top < 0) { return 0; } else { int x = a[top--]; return x; } } int Stack::peek() { if (top < 0) { return 0; } else { int x = a[top]; return x; } } bool Stack::isEmpty() { return (top < 0); } int main() { class Stack stackInst; // заполняем стак for(size_t i = 0; i < MAX; i++) { stackInst.push(i); } // избавляемся от четных элементов стака class Stack stackBuffer; while (!stackInst.isEmpty()) { int val = stackInst.peek(); stackInst.pop(); if (val % 2 == 1) stackBuffer.push(val); } while (!stackBuffer.isEmpty()) { stackInst.push(stackBuffer.peek()); stackBuffer.pop(); } // стак на выходе cout << "current stack data: "; while(!stackInst.isEmpty()) { cout<<stackInst.peek()<<" "; stackInst.pop(); } return 0; } /* output: push 0 push 1 push 2 push 3 push 4 push 5 push 6 push 7 push 8 push 9 push 9 push 7 push 5 push 3 push 1 push 1 push 3 push 5 push 7 push 9 current stack data: 9 7 5 3 1 */
я ниже писал про современный методЧто это за треш, думаю не стоит приводить в пример такую ебанутую реализацию
#include <iostream>
#include <stack>
const int CONST_MAX_SIZE = 10;
int main() {
std::stack<int> stackInst;
std::stack<int> stackBuffer;
for (size_t i = 0; i < CONST_MAX_SIZE; i++) {
stackInst.push(i);
}
while (!stackInst.empty()) {
int topValue = stackInst.top();
stackInst.pop();
if (topValue % 2 == 1) {
stackBuffer.push(topValue);
}
}
while (!stackBuffer.empty()) {
stackInst.push(stackBuffer.top());
stackBuffer.pop();
}
std::cout << "current stack data: ";
while (!stackInst.empty()) {
std::cout << stackInst.top() << " ";
stackInst.pop();
}
return 0;
}
Если тебе нужно включить отображение ников через стены, то нужно ставить falseЯ не понимаю как использовать sampapi, пожалуйста кто шарит за этот кал покажите будет выглядеть готовое решение, чтобы понять как с этим работать
C:[/B] { Sleep(1); } sampapi::v037r3::RefNetGame()->m_pSettings->m_bNoNametagsBehindWalls = true ; }