Also ich bin angemdlet
http://www.pic-upload.de/view-23372408/debug.png.html
Der code
public ptimer(playerid) {
if(!IsPlayerConnectedEx(playerid)) return 1;
printf("State: %i",IsPlayerOnDesktop(playerid));
new aimtplayer = GetPlayerTargetPlayer(playerid), msg[109];
if(aimtplayer != INVALID_PLAYER_ID) {
if(!IsPlayerNPC(aimtplayer)) return 1;
if(IsPlayerInRangeOfPoint(playerid,4.0,1373.8241,-1758.2440,13.5481)) Bankrob(playerid);
if(!strcmp(BotInfo[aimtplayer][botname],"Bankdame2",false)) {
if(!BotInfo[aimtplayer][inanimation]) ApplyAnimation(aimtplayer,"ped","handsup",4.1,0,1,1,1,0,1), BotInfo[aimtplayer][inanimation] = true, SetTimerEx("ClearAnimation",1000*60,false,"i",aimtplayer);
if(PlayerInfo[playerid][bankrob] == true) PlayerInfo[playerid][bankrobsecs]++;
}
if(!strcmp(BotInfo[aimtplayer][botname],"Bankdame1",false) || !strcmp(BotInfo[aimtplayer][botname],"Bankdame2_Ani",false)) if(!BotInfo[aimtplayer][inanimation] && IsPlayerInRangeOfPoint(playerid,5.0,1375.9094,-1759.5554,13.5504)) ApplyAnimation(aimtplayer,"ped","handsup",4.1,0,1,1,1,0,1), BotInfo[aimtplayer][inanimation] = true, SetTimerEx("ClearAnimation",1000*60,false,"i",aimtplayer);
} else if(aimtplayer == INVALID_PLAYER_ID) {
if(PlayerInfo[playerid][bankrob]) PlayerInfo[playerid][btimer]++;
if(PlayerInfo[playerid][bankrob] && PlayerInfo[playerid][btimer] > 10) GivePlayerMoney(playerid,PlayerInfo[playerid][bankrobsecs]*10), format(msg,sizeof(msg),"Du hast $%i erbeutet!",PlayerInfo[playerid][bankrobsecs]*10), SendClientMessage(playerid,white,msg), PlayerInfo[playerid][bankrob] = false, PlayerInfo[playerid][btimer] = 0, PlayerInfo[playerid][bankrobsecs] = 0, SendCopMsg(lightblue,"[SECURE-SYSTEM]: Der manuelle Alarmschalter in der Bank wurde betätigt!");
}
new Float: armourx;
GetPlayerArmour(playerid,armourx);
if(armourx == 0) SetPlayerArmourEx(playerid,0);
new t = gettime();
printf("pLU: %i || Time: %i, reachedT: %i", p_LastUpdate[playerid], t, t-1000);
if(p_AFK[playerid] == 0 && p_LastUpdate[playerid] < t-1000) p_AFK[playerid] = 1;
UpdateNametag(playerid);
return 1;
}
Wenn ich auff Desktop bin returnt er 0
public OnPlayerUpdate(playerid)
{
p_LastUpdate[playerid] = gettime();
p_AFK[playerid] = 0;
return 1;
}
Deine IsPlayerOnline Abfrage hab ich rausgeklatscht da der Timer erst gestratet wird (ptimer) wenn der spieler einbgeloggt ist