25.09.2013, 23:28
pawn Код:
stock loadgates()
{
new fail[256];
for(new i; i <MAX_GATES; i++)
{
format(fail,sizeof(fail),gatepath,i);
if(fexist(fail))
{
GateInfo[i][area] = CreateDynamicCircle(GateInfo[i][xx],GateInfo[i][yy],5, -1, -1, -1);
INI_ParseFile(fail, "gate_data", .bExtra = true, .extra = i);
GateInfo[i][gates] = CreateDynamicObject(980,GateInfo[i][xx],GateInfo[i][yy],GateInfo[i][zz],GateInfo[i][rxx],GateInfo[i][ryy],GateInfo[i][rzz]);
new text[300];
format(text,sizeof(text),"Autogate \nID = %d",GateInfo[i][id]);
GateInfo[i][label] = CreateDynamic3DTextLabel(text,0x8000FFFF,GateInfo[i][xx],GateInfo[i][yy],GateInfo[i][zz],40);
}
}
return 1;
}
pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
for(new i; i < MAX_GATES; i++)
{
if(areaid == GateInfo[i][area] )
{
MoveDynamicObject(GateInfo[i][gates],GateInfo[i][xx],GateInfo[i][yy],GateInfo[i][zz]+5,2);
}
}
return 1;
}
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
for(new i; i < MAX_GATES; i++)
{
if(areaid == GateInfo[i][area] )
{
MoveDynamicObject(GateInfo[i][gates],GateInfo[i][xx],GateInfo[i][yy],GateInfo[i][zz],2);
}
}
return 1;
}