Quote (dimen_33rus)
Помогите, пожалуйста. Мы играем на данном сервере втроем, у нашего провайдера один ай пи на всех. Друга забанили из за и нас соответственно тоже....
ну такова жизнь......
напиши на сайт сервера вашу проблемку возможно разбанят
Quote (C1NeT)
Парни у кого нибудь есть код магазина с одеждой очень надо помогите!!!!
Забей в google FS смена одежды samp таковые скрипты уже залиты в инет
Quote (king_5)
Помогите сделать чтобы при построении объекта в игре - его ид и координаты сохранялись в определённый файл, а при загрузке сервера данные брались из это файла и с их помощью расставлялись эти объекты. С меня + и награда.
в начало
new CreatedObject[700]; // ну тут можно макс сменить
new CreatedObject = 0;
в паблик инит
new total_object_from_files=0;
total_object_from_files += LoadStaticObjectFromFile("pos.txt");
Code
В паблик команд
if(strcmp(cmd, "/create", true) == 0 ){
if (IsPlayerAdmin(playerid) == 1){
new objid1;
new rot;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_RED, " /create [ID обьекта] [Угол поворота]");
return 1;
}
objid1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_RED, " /create [ID обьекта] [Угол поворота]");
return 1;
}
new Float:X, Float:Y,Float:Z,Float:rX,Float:rY;
GetPlayerPos(playerid, X, Y, Z);
rot = strval(tmp);
SetPlayerPos(playerid,X,Y,Z +5);
CreateObject(objid1, X, Y, Z, rX, rY, rot);
new Float:px, Float:py, Float:pz, Float:ang;
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid,ang);
new coordsstring[256];
format(coordsstring, 256, "%.1f,%.1f,%.1f,%.1f, Int: %d // %s\n", px, py, pz, ang,GetPlayerInterior(playerid),result);
SendClientMessage(playerid, COLOR_YELLOW, coordsstring);
SendClientMessage(playerid, COLOR_YELLOW," /loadobject эта команда будет загружать поставленные тобою обьекты");
new File:hFile;
hFile = fopen("pos.txt", io_append);
fwrite(hFile, coordsstring);
fclose(hFile);
}else{SendClientMessage(playerid, COLOR_GRAD1, " Выполняет данное действие лишь администратор");}
return 1;
}
if(strcmp(cmdtext,"/loadobject",true)==0){
if (IsPlayerAdmin(playerid) == 1){
SendClientMessage(playerid, COLOR_YELLOW," Обьекты перезагружены");
LoadStaticObjectFromFile("pos.txt");
}else{
SendClientMessage(playerid, COLOR_GRAD1, "Выполняет данное действие лишь администратор");}
return 1;
}
При этом создай в scriptfiles pos.txt
Наверно придется еще использовать инклуд dini
public RestorationMainFiles()
{
if (!dini_Exists("pos.txt")) {
dini_Create("pos.txt");
}
}
LoadStaticObjectFromFile(const filename[])
{
new File:file_ptr;
new line[256];
new var_from_line[64];
new objecttype;
new Float:SpawnX;
new Float:SpawnY;
new Float:SpawnZ;
new Float:SpawnRot;
new index;
new object_loaded;
new init;
file_ptr = fopen(filename,filemode:io_read);
if(!file_ptr) return 0;
object_loaded = 0;
while(fread(file_ptr,line,256) > 0)
{
CreatedObject = 0;
index = 0;
// Read type
index = token_by_delim(line,var_from_line,',',index);
if(index == (-1)) continue;
vehicletype = strval(var_from_line);
if(vehicletype < 400 || vehicletype > 611) continue;
// Read X, Y, Z, Rotation
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
SpawnX = floatstr(var_from_line);
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
SpawnY = floatstr(var_from_line);
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
SpawnZ = floatstr(var_from_line);
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
SpawnRot = floatstr(var_from_line);
// Read Color1, Color2
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
Color1 = strval(var_from_line);
index = token_by_delim(line,var_from_line,',',index+1);
if(index == (-1)) continue;
Color2 = strval(var_from_line);
index = token_by_delim(line,var_from_line,';',index+1);
if(index == (-1)) continue;
init = strval(var_from_line);
LinkObjectToInterior(objecttype, init);
new objectid = CreateObject(objecttype,SpawnX,SpawnY,SpawnZ,SpawnRot,60000);
CreatedObject[CreatedObject] = objectid;
CreatedObject ++;
object_loaded++;
}
fclose(file_ptr);
printf("Loaded %d object from: %s",object_loaded,filename);
return object_loaded;
}