give player object help
#1

hello today i find a little bug in my script ... editobject command work only on me .. i can edit the attached object in my id .. but to other id not showing edit option ... what happen

Quote:

CMD:giveobject(playerid,params[])
{
new TargetID,slot,bone,count,str1[128];
if(LoginCheck[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(pInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(sscanf(params, "uddd", TargetID,slot,objectident,bone)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /giveobject[id] [slot] [object id] [bone]");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_RED, ""CONNECTION_ERROR"");
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(TargetID, i)) count++;
}
if(count > 10) return SendClientMessage(playerid,COLOR_RED,"All Of The Target Player's Object Slots Are Full.");
if(IsPlayerAttachedObjectSlotUsed(TargetID,slot)) return SendClientMessage(playerid,COLOR_RED,"This Object Slot Is Already In Use.");
if(slot < 0 || slot > 9) return SendClientMessage(playerid, COLOR_RED, "Invalid Slot ID. Valid Slot ID Numbers Are From 0-9.");
if(bone < 1 || bone > 1 return SendClientMessage(playerid, COLOR_RED, "Invalid Bone ID. Valid Bone ID Numbers Are From 1-18.");
else
{
format(str1,sizeof(str1),"You Have Attached Object %d To %s (%d). Slot: %d. Bone: %d.",objectident,pname(TargetID),TargetID,slot,bon e);
SetPlayerAttachedObject(TargetID, slot, objectident, bone);
SendClientMessage(playerid,COLOR_HOTPINK,str1);
AdminMsg(playerid,"attachobject");
}
return 1;
}




CMD:editaobject(playerid,params[])
{
new TargetID,slot,str1[128];
if(LoginCheck[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(pInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(sscanf(params, "ud", TargetID,slot)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /editaobject [id] [slot]");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_RED, ""CONNECTION_ERROR"");
if(!IsPlayerAttachedObjectSlotUsed(TargetID,slot)) return SendClientMessage(playerid,COLOR_RED,"No Objects Could Be Found In This Slot.");
if(slot < 0 || slot > 9) return SendClientMessage(playerid, COLOR_RED, "Invalid Slot ID. Valid Slot ID Numbers Are From 0-9.");
else
{
format(str1,sizeof(str1),"Now Editing Attached Object Slot %d On %s (%d).",slot, pname(TargetID),TargetID);
SendClientMessage(playerid,COLOR_HOTPINK,str1);
EditAttachedObject(TargetID, slot);
AdminMsg(playerid,"editaobject");
}
return 1;
}




CMD:deleteaobject(playerid,params[])
{
new TargetID,slot,str1[128];
if(LoginCheck[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(pInfo[playerid][AdminLevel] < 2) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(sscanf(params, "ud", TargetID,slot)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /deleteaobject [id] [slot]");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_RED, ""CONNECTION_ERROR"");
if(!IsPlayerAttachedObjectSlotUsed(TargetID,slot)) return SendClientMessage(playerid,COLOR_RED,"No Objects Could Be Found In This Slot.");
if(slot < 0 || slot > 9) return SendClientMessage(playerid, COLOR_RED, "Invalid Slot ID. Valid Slot ID Numbers Are From 0-9.");
else
{
format(str1,sizeof(str1),"You Have Deleted Attached Object Slot %d On %s (%d).",slot, pname(TargetID),TargetID);
SendClientMessage(playerid,COLOR_HOTPINK,str1);
RemovePlayerAttachedObject(TargetID, slot);
AdminMsg(playerid,"deleteaobject");
}
return 1;
}

Quote:

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)
{
if(response)
{
ao[playerid][index][ao_x] = fOffsetX;
ao[playerid][index][ao_y] = fOffsetY;
ao[playerid][index][ao_z] = fOffsetZ;
ao[playerid][index][ao_rx] = fRotX;
ao[playerid][index][ao_ry] = fRotY;
ao[playerid][index][ao_rz] = fRotZ;
ao[playerid][index][ao_sx] = fScaleX;
ao[playerid][index][ao_sy] = fScaleY;
ao[playerid][index][ao_sz] = fScaleZ;
}
else
{
new i = index;
SetPlayerAttachedObject(playerid, index, objectident, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
}
return 1;
}

Reply
#2

I doubt someone will help you if your code have no intendation.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)