16.08.2015, 23:48
Hey, so i need help.. so how to make random object create in mapp and create on object 3dtext, and if i near that object i can use key_N
enum ObjectData
{
ModelID,
Float:oPosX,
Float:oPosY,
Float:oPosZ,
Float:oRotX,
Float:oRotY,
Float:oRotZ
}
static const oInfo[][ObjectData] =
{
{1225, 0.00, 0.00, 0.00, 0.00,0.00, 0.00},
{1226, 0.00, 0.00, 0.00, 0.00,0.00, 0.00}
};
public OnGameModeInit()
{
for(new i = 0; i < sizeof(oInfo); i++)
{
CreateObject(oInfo[i][ModelID],oInfo[i][oPosX],oInfo[i][oPosY],oInfo[i][oPosZ],oInfo[i][oRotX],oInfo[i][oRotY],oInfo[i][oRotZ]);
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO)
{
for(new i = 0; i < sizeof(oInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, oInfo[i][oPosX],oInfo[i][oPosY],oInfo[i][oPosZ]))
{
SendClientMessage(playerid, -1, "You are in range of the object.");
break;
}
}
}
return 1;
}