
Untitled
By: a guest on
Aug 19th, 2012 | syntax:
None | size: 1.32 KB | hits: 14 | expires: Never
#include <a_samp>
#define OBJECT_MODEL 1607 // whale id
#define OBJECT_SPEED 3.0 //How fast it gonna follow you
new
Float:PL_POS[MAX_PLAYERS][4],
ACTIVE_PL[MAX_PLAYERS],
OBJ_ID[MAX_PLAYERS];
public OnFilterScriptInit()
{
SetTimer("T_REFRESH", 500, true);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/createwhale", cmdtext, true, 10) == 0)
{
ACTIVE_PL[playerid]=1;
GetPlayerPos(playerid, PL_POS[playerid][0], PL_POS[playerid][1], PL_POS[playerid][2]);
GetPlayerFacingAngle( playerid, PL_POS[playerid][3]);
OBJ_ID[playerid] = CreateObject(OBJECT_MODEL,PL_POS[playerid][0]-1.0, PL_POS[playerid][1], PL_POS[playerid][2],87.640026855469,342.13500976563, 350.07507324219);
SetObjectRot( OBJ_ID[playerid],PL_POS[playerid][3], PL_POS[playerid][3],PL_POS[playerid][3] );
SetTimerEx("T_REFRESH",500,0,"i",playerid);
return 1;
}
return 0;
}
forward T_REFRESH(playerid);
public T_REFRESH(playerid)
{
GetPlayerPos(playerid, PL_POS[playerid][0], PL_POS[playerid][1], PL_POS[playerid][2]);
GetPlayerFacingAngle( playerid, PL_POS[playerid][3]);
MoveObject(OBJ_ID[playerid], PL_POS[playerid][0]-1.0, PL_POS[playerid][1], PL_POS[playerid][2], OBJECT_SPEED);
SetObjectRot( OBJ_ID[playerid],0.0, 0.0,PL_POS[playerid][3] );
return 1;
}