Ich komme nicht mehr zurück, in den Drive By Modus. Wieso?
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
if((gettime()-DriveByCount[playerid]) > DRIVEBY_COUNT)
{
new tick = GetTickCount();
if(tick - g_TickPushed[playerid] < DOUBLE_CLICK_TIME)
{
g_Weapon[playerid] = GetPlayerWeapon(playerid);
g_Count[playerid] = REARMED_WEAPON_UPDATES;
ApplyAnimation(playerid,"PED","facanger",4.1,0,1,1,1,1);
SetPlayerArmedWeapon(playerid, 0);
DriveByCount[playerid] = gettime();
}
g_TickPushed[playerid] = tick;
SendClientMessage(playerid, COLOR_GREY, "Du kannst den DriveBy Modus mit der Taste 'H' wieder verlassen.");
}
else
{
new string[128];
format(string, sizeof(string),"Du kannst in %d Sekunden wieder in den Drive By Modus gehen.", (gettime()-DriveByCount[playerid]));
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(g_Count[playerid])
{
if(--g_Count[playerid] == 0)
{
SetPlayerArmedWeapon(playerid, g_Weapon[playerid]);
}
}
return 1;
}