26.02.2013, 02:41
PHP код:
CMD:object(playerid,params[])
{
if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /object [object id]");
new object = strval(params), string[128], Float:x, Float:y, Float:z, Float:a;
CMDMessageToAdmins(playerid,"OBJECT");
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
x += (3 * floatsin(-a, degrees));
y += (3 * floatcos(-a, degrees));
CreateObject(object, x, y, z, 0.0, 0.0, a);
format(string, sizeof(string), "CreateObject(%d, %0.2f, %0.2f, %0.2f, 0.00, 0.00, %0.2f);", object, x, y, z, a);
SaveToFile("Objects",string);
format(string, sizeof(string), "You Have Created Object %d, at %0.2f, %0.2f, %0.2f Angle %0.2f", object, x, y, z, a);
return SendClientMessage(playerid,yellow, string);
}