23.07.2014, 09:51
(
Последний раз редактировалось KayJ; 23.07.2014 в 09:52.
Причина: Sorry for late reply
)
pawn Код:
#include <a_samp>
#include <zcmd>
CMD:edit(playerid, params[])
{
new cmd[128], tmp[128], idx;
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, CBLUE, "|- ((ERROR)) You are not in any vehicle. -|");
if(sscanf(params, "u", amount)) return SendClientMessage(playerid, CBLUE, "|- ((ERROR)) Use: /edit [objectid] -|");
{
new i, bool:OtherObject;
for(i = 0; i < MAX_OBJECTS_PER_EDIT; i++)
{
if(PlayerData[playerid][ObjectID][i] == -1) break;
OtherObject = true;
if(i == (MAX_OBJECTS_PER_EDIT - 1)) return SendClientMessage(playerid, CBLUE, "|- ((ERROR)) You're editing the maximum of objects defined. -|");
}
new Obj = CreateObject(strval(tmp), 0.0, 0.0, -14.0, 0.0, 0.0, 0.0),
vId = GetPlayerVehicleID(playerid), str[148];
if(OtherObject)
{
PlayerData[playerid][ObjectModel][i] = strval(tmp);
PlayerData[playerid][EditionID] = i;
PlayerData[playerid][ObjectID][i] = Obj;
format(str, sizeof str, "|- Editing the object {F40B74}%d{4E76B1}, edition id {F40B74}%d{4E76B1}. Use KEY_LEFT, KEY_RIGHT and KEY_FIRE to adjust the offset's -|", strval(tmp), i);
SendClientMessage(playerid, CBLUE, str);
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/X /Y or /Z{4E76B1} to adjust the linear offsets -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/RX /RY or /RZ{4E76B1} to adjust the rotational offsets -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/EDITION{4E76B1} to switch between objects editions -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/FREEZE{4E76B1} and {F40B74}/UNFREEZE{4E76B1} to freeze and unfreeze yourself -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/STOP{4E76B1} to stop some edition. -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/SAVEOBJ{4E76B1} to save the object to file \"editions.pwn\". -|");
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Information", "Do you wish create a object in the same position of the last?", "Yes", "No");
return true;
}
PlayerData[playerid][VehicleID] = vId;
PlayerData[playerid][ObjectModel][i] = strval(tmp);
PlayerData[playerid][EditionID] = i;
PlayerData[playerid][OffSetX][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][OffSetY][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][OffSetZ][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][OffSetRX][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][OffSetRY][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][OffSetRZ][PlayerData[playerid][EditionID]] = 0.0;
PlayerData[playerid][ObjectID][i] = Obj;
MaterialData[playerid][PlayerData[playerid][EditionID]][MaterialModel] = 0;
MaterialData[playerid][PlayerData[playerid][EditionID]][MaterialTXDName] = EOS;
MaterialData[playerid][PlayerData[playerid][EditionID]][MaterialTEXName] = EOS;
PlayerData[playerid][TimerID] = SetTimerEx("GetKeys", 30, true, "i", playerid);
format(str, sizeof str, "|- Editing the object {F40B74}%d{4E76B1}, edition id {F40B74}%d{4E76B1}. Use KEY_LEFT, KEY_RIGHT and KEY_FIRE to adjust the offset's -|", strval(tmp), i);
SendClientMessage(playerid, CBLUE, str);
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/X /Y or /Z{4E76B1} to adjust the linear offsets -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/RX /RY or /RZ{4E76B1} to adjust the rotational offsets -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/MATERIALS{4E76B1} to choise an object material from the list -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/MATERIAL{4E76B1} to set an specifc object material -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/EDITION and /EDITIONS{4E76B1} to switch between objects editions -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/FREEZE{4E76B1} and {F40B74}/UNFREEZE{4E76B1} to freeze and unfreeze yourself -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/STOP{4E76B1} to stop some edition. -|");
SendClientMessage(playerid, CBLUE, "|- Use {F40B74}/SAVEOBJ{4E76B1} to save the object to file \"editions.pwn\". -|");
return true;
}