Guten Morgen liebe Community,
Ich habe folgendes Problem undzwar will ich einen Dialog aufrufen lassen mit der ALT Taste, aber es passiert einfach nichts und ich bekomme auch keine Fehler. Ich weiß nicht was ich falsch mache, aber es passiert einfach nichts Ingame. Hier mein GANZER Code vom KeyStateChange.
Der ganze Callback funktioniert nicht.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 16 && GetPlayerState(playerid == PLAYER_STATE_ONFOOT))
{
for(new i = 0; i < sizeof(SprunkSystemInfo); i++){
if(PlayerToPoint(1.2,playerid,SprunkSystemInfo[i][SSX],SprunkSystemInfo[i][SSY],SprunkSystemInfo[i][SSZ])){
if(PlayerInfo[playerid][pCash] >= 1){
SetPlayerFacingAngle(playerid, SprunkSystemInfo[i][SSRotZ]);
TogglePlayerControllable(playerid,0);
ApplyAnimation(playerid,"VENDING","VEND_Use",3.0,0,0,0,0,0); //sprunk machine animation
PlayerPlaySound(playerid,42600,0,0,0); //sprunk machine noise - NOT SUPPORTED IN SA:MP
GivePlayerMoneys(playerid,-1);
SetTimerEx("SprunkAnimEat", 1800, 0, "i", playerid);
break;
}
else
{
PlayerPlaySound(playerid,1053,0,0,0); //rejected money sound - works!
}}}}
if(!gPlayerUsingLoopingAnim[playerid]) return;
if(newkeys == KEY_FIRE)
{
if(PlayerInfo[playerid][pJailed] == 2)
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_YELLOW,"Es ist verboten, im Prison zu schlagen. Du wirst für 5 Minuten gefreezed!");
}
}
if(IsKeyJustDown(KEY_SPRINT,newkeys,oldkeys))
{
StopLoopingAnim(playerid);
TextDrawHideForPlayer(playerid, TextAnimation);
}
if(!IsPlayerInAnyVehicle(playerid))
{
if(IsBugWeapon(playerid) && RELEASED(KEY_FIRE)){
PlayerUsingBug[playerid] = 1;
SetTimerEx("BugTimeOut",800,0,"i",playerid);
}
if(PlayerUsingBug[playerid]==1 && newkeys != KEY_FIRE && newkeys & KEY_CROUCH){
ApplyAnimation(playerid,"FAT","IDLE_tired",2.0,0,0,0,0,4000,1);
PlayerUsingBug[playerid] = 0;
SetPlayerChatBubble(playerid, "Verdacht auf C-Bug", 0xFF0000FF, 30.0, 4000);
}
}
if(newkeys == KEY_WALK)
{
if(IsPlayerInRangeOfPoint(playerid, 2, 1565.9476,17.9115,24.1641))
{
ShowPlayerDialog(playerid, DIALOG_SMARKT, DIALOG_STYLE_LIST,"Schwarzmarkt","Drogen\nWaffen", "Weiter", "Abbrechen");
}
}
}