15.05.2012, 19:25
The title says it all, just use the function:
CreateObjectEx (model, Float: x, Float: y, Float: z, Float: rx, Float: ry, Float: rz, Float: draw, virtualword)
This is CODE:
I hope you enjoy
.
CreateObjectEx (model, Float: x, Float: y, Float: z, Float: rx, Float: ry, Float: rz, Float: draw, virtualword)
This is CODE:
pawn Код:
#include <a_samp>
new Timer[MAX_PLAYERS];
enum OInfo
{
Model,
Float:X,
Float:Y,
Float:Z,
Float:RX,
Float:RY,
Float:RZ,
Float:DRAW,
VirtualWord,
bool:Criado[MAX_PLAYERS],
Objeto
};
new Objetos, ObjectInfo[MAX_OBJECTS][OInfo];
public OnPlayerConnect(playerid)
{
Timer[playerid] = SetTimerEx("AtualizarObjetos", 1500, true, "i", playerid);
return 1;
}
#if defined _ALS_OnPlayerConnect
#undef OnPlayerConnect
#else
#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect object_OnPlayerConnect
forward object_OnPlayerConnect(playerid);
public OnPlayerDisconnect(playerid)
{
KillTimer(Timer[playerid]);
return 1;
}
#if defined _ALS_OnPlayerDisconnect
#undef OnPlayerDisconnect
#else
#define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect object_OnPlayerDisconnect
forward object_OnPlayerDisconnect(playerid);
stock CreateObjectEx(model, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:draw, virtualword)
{
Objetos ++;
if(Objetos >= MAX_OBJECTS) return print("Limete de Objetos Exedido"), Objetos --;
ObjectInfo[Objetos][VirtualWord] = virtualword;
ObjectInfo[Objetos][Model] = model;
ObjectInfo[Objetos][X] = x;
ObjectInfo[Objetos][Y] = y;
ObjectInfo[Objetos][Z] = z;
ObjectInfo[Objetos][RX] = rx;
ObjectInfo[Objetos][RY] = ry;
ObjectInfo[Objetos][RZ] = rz;
ObjectInfo[Objetos][DRAW] = draw;
return 1;
}
forward AtualizarObjetos(playerid);
public AtualizarObjetos(playerid)
{
new o;
while(o < MAX_OBJECTS)
{
if(GetPlayerVirtualWorld(playerid) == ObjectInfo[o][VirtualWord])
{
if(IsPlayerInRangeOfPoint(playerid, ObjectInfo[o][DRAW], ObjectInfo[o][X], ObjectInfo[o][Y], ObjectInfo
[o][Z]))
{
if(ObjectInfo[o][Criado][playerid] == false)
{
ObjectInfo[o][Objeto] = CreatePlayerObject(playerid, ObjectInfo[o][Model], ObjectInfo[o]
[X], ObjectInfo[o][Y], ObjectInfo[o][Z], ObjectInfo[o][RX], ObjectInfo[o][RY], ObjectInfo[o][RX], ObjectInfo[o][DRAW]);
ObjectInfo[o][Criado][playerid] = true;
}
}
else
{
ObjectInfo[o][Criado][playerid] = false;
DestroyPlayerObject(playerid, ObjectInfo[o][Objeto]);
}
}
else
{
ObjectInfo[o][Criado][playerid] = false;
DestroyPlayerObject(playerid, ObjectInfo[o][Objeto]);
}
o++;
}
}
native CreateObjectEx(model, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:draw, virtualword);
![Tongue](images/smilies/razz.gif)