03.09.2011, 12:31
OK, I have this code:
And this is how I call the callback:
All the prints in the dialog code shows, but not in the callback (not even TEST). The timer ID returns a correct value.
Anyone got any idea at all? I tried having this code in OnPlayerUpdate but it wouldn't call there either :/
Thanks,
Garsino.
pawn Code:
forward CheckPlayerKeys(playerid);
public CheckPlayerKeys(playerid)
{
print("test");
if(BrowsingSkin{playerid} == 1)
{
print("#0");
new skin_id = GetPlayerSkin(playerid), keys, ud, lr;
GetPlayerKeys(playerid, keys, ud, lr);
switch(lr)
{
case 128:
{
print("#1");
skin_id -= 1;
if(skin_id < 0)
{
skin_id = 299;
}
if(!IsValidSkin(skin_id))
{
for(new s = skin_id; s > 1; s--)
{
if(IsValidSkin(s))
{
skin_id = s;
break;
}
}
}
SetPlayerSkin(playerid, skin_id);
return 1;
}
case -128:
{
print("#2");
skin_id += 1;
if(skin_id > 299)
{
skin_id = 0;
}
if(!IsValidSkin(skin_id))
{
for(new s = skin_id; s > 0; s++)
{
if(IsValidSkin(s))
{
skin_id = s;
break;
}
}
}
SetPlayerSkin(playerid, skin_id);
return 1;
}
}
}
else
{
if(KeyCheckTimer[playerid] != -1)
{
KillTimer(KeyCheckTimer[playerid]), KeyCheckTimer[playerid] = -1;
}
}
return 1;
}
pawn Code:
case 13: // Browse
{
if(BrowsingSkin{playerid} != 0) return SendClientMessage(playerid, COLOUR_SYSTEM, "Error! {FFFFFF}You are already in skin browsing mode. Press ENTER/Space to end it.");
new Float:Pos[3];
print("OPDS: #1");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
OriginalSkinID[playerid] = GetPlayerSkin(playerid), BrowsingSkin{playerid} = 1;
ShowPlayerDialog(playerid, (SKINMENU - 1), DIALOG_STYLE_MSGBOX, DIALOG_HEADER, "Press {009900}AIM {ADC7E7}(aim weapon) to view the {009900}previous {ADC7E7}skin.\nPress {009900}FIRE {ADC7E7}(shoot weapon) to view the {009900}next {ADC7E7}skin.\nPress {009900}ENTER {ADC7E7}(enter/exit vehicle key) to {009900}select {ADC7E7}the skin.\nPress {009900}SPACE {ADC7E7}(Jump Key) to {009900}go back{ADC7E7}.", "Close", "");
TogglePlayerControllable(playerid, false);
print("OPDS: #2");
KeyCheckTimer[playerid] = SetTimerEx("CheckPlayerKeys", 150, 1, "i", playerid);
printf("KeyCheck: %d", KeyCheckTimer[playerid]);
print("OPDS: #3");
// secret
print("OPDS: #4");
return 1;
}
Anyone got any idea at all? I tried having this code in OnPlayerUpdate but it wouldn't call there either :/
Thanks,
Garsino.