Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-08-03, 12:52


Shiffu







Wiek: 28
Na forum: 5097 dni
Posty: 14



Respekt: 50

Mam problem dotycz?cy systemu obiekt?w, u?ywam opcji EditPlayerObject oraz EditObject, wpisuje komend? kt?ra daje mi dany obiekt i go przesuwam. po naci?ni?ciu tej "kasetki" oraz wy??czeniu serwera i ponownym w??czeniu jego obiekt stoi w tej pozycji przed przesuwaniem.

Kod:

public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
if(response == EDIT_RESPONSE_FINAL)
{
ZapiszObiekt(objectid);
}
}


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-08-03, 14:08


IgrexolonO







Wiek: 34
Na forum: 6809 dni
Posty: 1386

Piwa: 1062

Respekt: 651,8
Respekt: 651,8Respekt: 651,8

Poka? funkcj? ZapiszObject.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-08-03, 15:45


Shiffu







Wiek: 28
Na forum: 5097 dni
Posty: 14



Respekt: 50

Dam od razu razem z komend?. Funkcja ZapiszObiekt dzia?a poprawnie.

Kod:

CMD:mc(playerid,params[])
{
new obiekt,nrr;
if(sscanf(params, "d",obiekt)) return SendClientMessage(playerid,-1,"/mc [obiekt]");
for(nrr = 0; nrr < LIMIT_OBIEKTOW; nrr++)
{
if(BramaInfo[nrr][bAktywny]==false)
{
BramaID[playerid]=nrr;
BramaTworzenie=false;
break;
}
}
new nr=BramaID[playerid];
GetPlayerPos(playerid,BramaInfo[nr][bPosX],BramaInfo[nr][bPosY],BramaInfo[nr][bPosZ]);
BramaInfo[nr][bPosY]+=2.0;
BramaInfo[nr][bRotX]=0.0;
BramaInfo[nr][bRotY]=0.0;
BramaInfo[nr][bRotZ]=0.0;
BramaInfo[nr][bOwner]=1;
BramaInfo[nr][bOwnerID]=random(5000);
BramaInfo[nr][bObiekt]=obiekt;
BramaInfo[nr][bVir]=GetPlayerVirtualWorld(playerid);
Brama[nr]=CreateDynamicObject(BramaInfo[nr][bObiekt],BramaInfo[nr][bPosX],BramaInfo[nr][bPosY],BramaInfo[nr][bPosZ],BramaInfo[nr][bRotX],BramaInfo[nr][bRotY],BramaInfo[nr][bRotZ],BramaInfo[nr][bVir]);
BramaInfo[nr][bAktywny]=true;
BramaStatus[nr]=true;
BramaID[playerid]=9999;
EdytowanyObiekt[playerid]=nr;
SetPVarInt(playerid, "EdycjaObiektow", 1);
SelectObject(playerid);
ZapiszObiekt(nr);
return 1;
}

ZapiszObiekt(nr)
{
if(nr<0||nr>LIMIT_OBIEKTOW) return 1;
new file[40];
format(file,sizeof(file),"Obiekty/%d.ini",nr);
if(DOF2_FileExists(file))
{
DOF2_SetBool(file,"Aktywny",BramaInfo[nr][bAktywny]);
DOF2_SetInt(file,"Obiekt",BramaInfo[nr][bObiekt]);
DOF2_SetInt(file,"Vir",BramaInfo[nr][bVir]);
DOF2_SetFloat(file,"PosX",BramaInfo[nr][bPosX]);
DOF2_SetFloat(file,"PosY",BramaInfo[nr][bPosY]);
DOF2_SetFloat(file,"PosZ",BramaInfo[nr][bPosZ]);
DOF2_SetFloat(file,"RotX",BramaInfo[nr][bRotX]);
DOF2_SetFloat(file,"RotY",BramaInfo[nr][bRotY]);
DOF2_SetFloat(file,"RotZ",BramaInfo[nr][bRotZ]);
DOF2_SetInt(file,"Owner",BramaInfo[nr][bOwner]);
DOF2_SetInt(file,"OwnerID",BramaInfo[nr][bOwnerID]);
DOF2_SetInt(file,"Gate",BramaInfo[nr][bGate]);
DOF2_SetFloat(file,"GatePosX",BramaInfo[nr][bGatePosX]);
DOF2_SetFloat(file,"GatePosY",BramaInfo[nr][bGatePosY]);
DOF2_SetFloat(file,"GatePosZ",BramaInfo[nr][bGatePosZ]);
DOF2_SetInt(file,"GateSpeed",BramaInfo[nr][bGateSpeed]);
DOF2_SetInt(file,"n1",BramaInfo[nr][bN1]);
DOF2_SetInt(file,"n2",BramaInfo[nr][bN2]);
DOF2_SetInt(file,"n3",BramaInfo[nr][bN3]);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(file);
DOF2_SetBool(file,"Aktywny",BramaInfo[nr][bAktywny]);
DOF2_SetInt(file,"Obiekt",BramaInfo[nr][bObiekt]);
DOF2_SetInt(file,"Vir",BramaInfo[nr][bVir]);
DOF2_SetFloat(file,"PosX",BramaInfo[nr][bPosX]);
DOF2_SetFloat(file,"PosY",BramaInfo[nr][bPosY]);
DOF2_SetFloat(file,"PosZ",BramaInfo[nr][bPosZ]);
DOF2_SetFloat(file,"RotX",BramaInfo[nr][bRotX]);
DOF2_SetFloat(file,"RotY",BramaInfo[nr][bRotY]);
DOF2_SetFloat(file,"RotZ",BramaInfo[nr][bRotZ]);
DOF2_SetInt(file,"Owner",BramaInfo[nr][bOwner]);
DOF2_SetInt(file,"OwnerID",BramaInfo[nr][bOwnerID]);
DOF2_SetInt(file,"Gate",BramaInfo[nr][bGate]);
DOF2_SetFloat(file,"GatePosX",BramaInfo[nr][bGatePosX]);
DOF2_SetFloat(file,"GatePosY",BramaInfo[nr][bGatePosY]);
DOF2_SetFloat(file,"GatePosZ",BramaInfo[nr][bGatePosZ]);
DOF2_SetInt(file,"GateSpeed",BramaInfo[nr][bGateSpeed]);
DOF2_SetInt(file,"n1",BramaInfo[nr][bN1]);
DOF2_SetInt(file,"n2",BramaInfo[nr][bN2]);
DOF2_SetInt(file,"n3",BramaInfo[nr][bN3]);
DOF2_SaveFile();
}
return 1;
}


Postaw piwo autorowi tego posta
 

 
Tagi: system :: obiektów.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku