07.04.2013, 10:39
(
Последний раз редактировалось Minko; 07.04.2013 в 13:26.
)
Hi, I would like to create my first streamer for pickups. But when I go to pickup ingame ... the pickup does not show.. my amx file has without this inc 150kb and with this include has 450kb and I dont know why..
INC File:
INC File:
pawn Код:
#define MAX_PICKUPS_EX 800
forward GUPick_Update();
forward GUPick_OnGameModeInit();
enum GUPick_Info{
P_Model,
P_Type,
P_World,
P_Interior,
Float:P_X,
Float:P_Y,
Float:P_Z,
Float:P_Vis,
bool: isCreated
};
enum GUPick_PlayerInfo{
bool:isPickupStreamed,
PickupCreatedID
};
new ACT_GUPICK_ID = -1;
new GUPickup[MAX_PICKUPS_EX][GUPick_Info];
new GUPlayerPickup[MAX_PLAYERS_EX][MAX_PICKUPS_EX][GUPick_PlayerInfo];
stock CreateStrPickup(GUP_Model, GUP_Type, Float: GUP_X, Float: GUP_Y, Float: GUP_Z, Float: GUP_Vis = 75.0, GUP_World=-1, GUP_Interior=0)
{
if(ACT_GUPICK_ID > MAX_PICKUPS_EX)
{
printf("Počet pickupov je limitovanэ na %d vбљ počet je %d !, Server sa vypнna", MAX_PICKUPS_EX, ACT_GUPICK_ID);
SendRconCommand("exit");
}else{
ACT_GUPICK_ID++;
GUPickup[ACT_GUPICK_ID][P_Model] = GUP_Model;
GUPickup[ACT_GUPICK_ID][P_Type] = GUP_Type;
GUPickup[ACT_GUPICK_ID][P_X] = GUP_X;
GUPickup[ACT_GUPICK_ID][P_Y] = GUP_Y;
GUPickup[ACT_GUPICK_ID][P_Z] = GUP_Z;
GUPickup[ACT_GUPICK_ID][P_Vis] = GUP_Vis;
GUPickup[ACT_GUPICK_ID][P_World] = GUP_World;
GUPickup[ACT_GUPICK_ID][P_Interior] = GUP_Interior;
GUPickup[ACT_GUPICK_ID][isCreated] = true;
}
return ACT_GUPICK_ID;
}
stock DestroyStrPickup(pickup)
{
if(pickup > ACT_GUPICK_ID || pickup < 0)
return 0;
GUPickup[ACT_GUPICK_ID][isCreated] = false;
for(new i=0;i<=MAX_PLAYERS_EX;i++)
{
if(GUPlayerPickup[i][pickup][isPickupStreamed] == true)
{
GUPlayerPickup[i][pickup][isPickupStreamed] == false;
DestroyPickup(pickup);
}
}
return 1;
}
public GUPick_OnGameModeInit()
{
SetTimer("GUPick_Update", 1000, true);
return 1;
}
public GUPick_Update()
{
print("Update");
for(new i=0;i<=MAX_PLAYERS_EX;i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
for(new p=0; p<ACT_GUPICK_ID; p++)
{
if(GUPickup[p][isCreated] == true)
{
if(GetPlayerInterior(i) == GUPickup[p][P_Interior])
{
if(IsPlayerInRangeOfPoint(i, GUPickup[p][P_Vis], GUPickup[p][P_X], GUPickup[p][P_Y], GUPickup[p][P_Z]))
{
if(GetPlayerVirtualWorld(i) == GUPickup[p][P_World])
{
GUPlayerPickup[i][p][PickupCreatedID] = CreatePickup(GUPickup[p][P_Model], GUPickup[p][P_Type], GUPickup[p][P_X], GUPickup[p][P_Y], GUPickup[p][P_Z], GUPickup[p][P_World]);
GUPlayerPickup[i][p][isPickupStreamed] = true;
}
}else if(!IsPlayerInRangeOfPoint(i, GUPickup[p][P_Vis], GUPickup[p][P_X], GUPickup[p][P_Y], GUPickup[p][P_Z])){
DestroyPickup(GUPlayerPickup[i][p][PickupCreatedID]);
}
}
}
}
}
}
return 1;
}