13.02.2016, 15:20
My dick is out of with this fucking AMX. I've tried to do this what I mentioned before, for first argument it works, but for more not.
My code
Printed result should be:
szőrцs fasz 0, 2000
But it:
szőrцs fasz 0, 150 <- setting second parameter doesn't work
Any ideas how to solve this problem?
My code
Printed result should be:
szőrцs fasz 0, 2000
But it:
szőrцs fasz 0, 150 <- setting second parameter doesn't work
pawn Код:
void CCallbackManager::OnPlayerClientGameInit(WORD playerid, bool* limitglobalchat, float* globalchatradius, float* nametagdistance, bool* disableenterexits)
{
int idx = -1;
cell ret = 1;
for (std::vector<AMX*>::const_iterator iter = m_vecAMX.begin(); iter != m_vecAMX.end(); ++iter)
{
if (!amx_FindPublic(*iter, "OnPlayerClientGameInit", &idx))
{
cell addr = NULL, amx_addr, *phys_ptr;
cell data[2];
data[0] = static_cast<cell>(*limitglobalchat);
data[1] = static_cast<cell>(*globalchatradius);
//data[2] = amx_ftoc(*nametagdistance);
//data[3] = static_cast<cell>(*disableenterexits);
amx_PushArray(*iter, &amx_addr, &phys_ptr, data, 2);
//*globalchatradius = reinterpret_cast<cell*>(phys_ptr);
//cell limitglobalchat_ = 1;
//amx_PushArray(*iter, &amx_addr, &phys_ptr, reinterpret_cast<cell*>(&limitglobalchat), 1);
//amx_PushString(*iter, &addr, NULL, str.c_str(), NULL, NULL);
amx_Push(*iter, static_cast<cell>(playerid));
amx_Exec(*iter, &ret, idx);
amx_Release(*iter, amx_addr);
//*limitglobalchat = !!*phys_ptr;
logprintf("szőrцs fasz %d, %d", phys_ptr[0], phys_ptr[1]);
//logprintf("globalchat: %d, %f", *limitglobalchat, *globalchatradius);
}
}
}
forward OnPlayerClientGameInit(playerid, &limitglobalchat, &globalchatradius);
public OnPlayerClientGameInit(playerid, &limitglobalchat, &globalchatradius)
{
limitglobalchat = 0;
globalchatradius = 2000;
// nametagdistance = -50.2;
// disableenterexits = false;
printf("lуfasz - %d", limitglobalchat);
}