Sistema de Acessorios -
Strike_Legends - 16.07.2012
Ola a todos, Bom eu queria uma ajuda de vocкs para ajuda a resolver um poblema. Bom й o seguinte eu tenho um sistema de acessorios em meu servidor ele tem um modo de editar a posiзгo do objeto em dialog, mais eu queria por ele para editar as posiзгos tipo do aplicativo do sa-mp attachments, eu adaptei ele para o meu gamemode ai fucionou tudo certinho mais na hora que click no icone de salva ele nгo salva ou sei la oque acontece olha o code:
Code default do aplicativo:
PHP код:
public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
Float:fRotX, Float:fRotY, Float:fRotZ,
Float:fScaleX, Float:fScaleY, Float:fScaleZ )
{
new debug_string[256+1];
format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
print(debug_string);
//SendClientMessage(playerid, 0xFFFFFFFF, debug_string);
SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");
return 1;
}
Ai eu coloquei ele desse jeito:
PHP код:
public OnPlayerEditAttachedObject( playerid, response, index)
{
new debug_string[256+1];
format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
index,PlayerToyInfo[playerid][slotselection[playerid]][ptModelID],
PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX],
PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ],
PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX],
PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]);
print(debug_string);
//SendClientMessage(playerid, 0xFFFFFFFF, debug_string);
SetPlayerAttachedObject(playerid, slotselection[playerid], PlayerToyInfo[playerid][slotselection[playerid]][ptModelID],
PlayerToyInfo[playerid][slotselection[playerid]][ptBone], PlayerToyInfo[playerid][slotselection[playerid]][ptPosX],
PlayerToyInfo[playerid][slotselection[playerid]][ptPosY], PlayerToyInfo[playerid][slotselection[playerid]][ptPosZ],
PlayerToyInfo[playerid][slotselection[playerid]][ptRotX], PlayerToyInfo[playerid][slotselection[playerid]][ptRotY],
PlayerToyInfo[playerid][slotselection[playerid]][ptRotZ], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleX],
PlayerToyInfo[playerid][slotselection[playerid]][ptScaleY], PlayerToyInfo[playerid][slotselection[playerid]][ptScaleZ]);
SendClientMessage(playerid, 0xFFFFFFFF, "Vocк terminou de editar seu acessorio.");
return 1;
}
O Sistema de salvamento dos acessorios do meu servidor й desse jeito:
PHP код:
enum ptInfo
{
ptModelID,
ptBone,
Float:ptPosX,
Float:ptPosY,
Float:ptPosZ,
Float:ptRotX,
Float:ptRotY,
Float:ptRotZ,
Float:ptScaleX,
Float:ptScaleY,
Float:ptScaleZ
};
Bom й isso se eu fiz algo errado ou sei la se estiver faltando algum code me ajuda ae porfavor й isso ae galera. estou aguardando vlw.
#Edit
Na hora que eu click em salvar ele fuciona normalmente ele fica no lugar certo que eu coloquei na posiзгo mais nгo salva fica sу na posiзгo mesmo.